Trigger a click event on bind - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:bind

Description

Trigger a click event on bind

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.10.1.js"></script> 
   </head> 
   <body> 
      <ul id="jsddm"> 
         <li id="vehicle">Vehicle</li> 
      </ul> 
      <script type="text/javascript">
function openVehicleMenu() {//from  w  ww  .jav a2  s.co  m
    console.log('openVehicleMenu');
}
$('#jsddm > #vehicle').bind('click', openVehicleMenu);

      </script>  
   </body>
</html>

Related Tutorials