Set div content with html() method - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

Set div content with html() method

Demo Code

ResultView the demo in separate window


<html>
   <head> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> 
   </head> 
   <body> 
      <div id="personName"></div> 
      <script>
var myName = "test";
$("#personName").html(myName);

      </script>  
   </body>/*from  ww w. j  a va  2s. c o  m*/
</html>

Related Tutorials