Bind action to parent form and get what child triggered the bind event - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:bind

Description

Bind action to parent form and get what child triggered the bind event

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.2.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*  www.j a  va2 s.c  o  m*/
$("#form-id").bind('keyup change', function(e) {
    console.log(e.target.id);
});
    });

      </script> 
 </head> 
 <body> 
  <form id="form-id"> 
   <input type="text" id="example"> 
  </form>  
 </body>
</html>

Related Tutorials