Javascript examples for jQuery Method and Property:html
Set to innerHTML via html() function
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.js"></script> <script type="text/javascript"> window.onload=function(){//from w w w .ja v a 2s .co m $('#name1').text("YO"); $('#name2').html("<b>YO</b>"); } </script> </head> <body> <div id="name1"></div> <div id="name2"></div> </body> </html>