Get element by ID - Javascript jQuery Selector

Javascript examples for jQuery Selector:id

Description

Get element by ID

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-2.1.0.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from   w w w  .  j  ava 2 s .c  om
$('#test').hover(function(){
    console.log('its working');
});
    });

      </script> 
   </head> 
   <body> 
      <button id="test">hover me</button>  
   </body>
</html>

Related Tutorials