Javascript examples for jQuery Method and Property:html
Changing div content using jQuery
<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 ww . j a va2 s.c om*/ server = "Testing123", content = "", background = ""; content = '<p class="server-message ' + server + '">testing <strong>' + server + '</strong> server</p>'; $("#spock").html(content); }); </script> </head> <body> <div id="spock"></div> </body> </html>