0

I have one input and that input have two events bind with it like below

<input type="text" class="textinput"/>

<script>
    $(".textinput").focusin(function(){
        //some code
    }
    $(".textinput").focusout(function(){
        //some code
    }
</script>

is there any programmatic way to find number of events bind with .textinput" input ?

i tried searching on google but not helping much.

Dhaval Pankhaniya
  • 1,996
  • 1
  • 15
  • 26
  • Why would you need to know the number of attached event handlers? – Andreas Oct 26 '17 at 07:48
  • increasing my JQuery knowledge :) – Dhaval Pankhaniya Oct 26 '17 at 07:52
  • 1
    Yes, you can here is the method https://stackoverflow.com/questions/2008592/can-i-find-events-bound-on-an-element-with-jquery – Asmarah Oct 26 '17 at 07:55
  • 1
    you willl get some hints [here](https://stackoverflow.com/questions/2518421/jquery-find-events-handlers-registered-with-an-object) and for an actual example [there](https://github.com/ruidfigueiredo/findHandlersJS/blob/master/findEventHandlers.js). But it works only for events registered with jQuery (apparently no way to do this for pure JS events) – Kaddath Oct 26 '17 at 08:03

0 Answers0