Add line breaks to div - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

Add line breaks to div

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.4.2.js"></script> 
      <script type="text/javascript">
    $(function(){//from  w  w  w  .j a  va2  s .  c  o m
$(document).ready(function(){
       var t = $('#test');
       t.html('<span>Hello</span><br/><span>World!</span');
});
    });

      </script> 
   </head> 
   <body> 
      <div id="test"></div>  
   </body>
</html>

Related Tutorials