JQuery Assigning DOM element to an object - Javascript jQuery

Javascript examples for jQuery:Tag Edit

Description

JQuery Assigning DOM element to an object

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://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
    window.onload=( function() {/*from   w  w w  .jav  a  2 s  .c  o  m*/
$(document).ready(function() {
    var $nav = $("nav");
    var height = $nav.height();
    console.log(height);
});
    });

      </script> 
   </head> 
   <body> 
      <nav> 
      </nav>  
   </body>
</html>

Related Tutorials