Select/find an element inside an event.currentTarget in Jquery - Javascript jQuery

Javascript examples for jQuery:Selector

Description

Select/find an element inside an event.currentTarget in Jquery

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.8.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from  w w  w.ja va  2s  . c o  m
$('#foo').on('click', '.bar', function(e) {
    console.log(e.currentTarget === this);
});
    });

      </script> 
 </head> 
 <body> 
  <div id="foo"> 
   <div class="bar">
     click me 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials