Using variable in jquery script - Javascript jQuery

Javascript examples for jQuery:Variable

Description

Using variable in jquery script

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(){/*w w  w.  j av  a2s  .c  om*/
var test= $(document).find('aside#bar');
var list= test.find('ul');
$(document).ready(function () {
  list.html("testing message");
});
    });

      </script> 
 </head> 
 <body> 
  <aside id="bar"> 
   <ul> 
   </ul> 
  </aside>  
 </body>
</html>

Related Tutorials