Javascript examples for jQuery:Variable
Using variable in jquery script
<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>