Javascript examples for jQuery Method and Property:html
insert javascript code in html
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.5.2.js"></script> <script type="text/javascript"> $(window).load(function(){//w ww . ja va2 s . co m var href = 'http://java2s.com'; var label = 'test'; var anchor_element = '<a href="' + href + '">' + label + '</a>'; $('#tester').append(anchor_element); }); </script> </head> <body> <div id="tester"> abcd </div> </body> </html>