Split the string based on <br/> tag using jquery - Javascript jQuery

Javascript examples for jQuery:String

Description

Split the string based on <br/> tag using jquery

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.8.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*from  www . ja v a  2s  . c  om*/
jQuery(document).ready(function($)
    {
        var lines = ('this is for testing <br/> How are you<br/>').split("<br/>");
        jQuery.each(lines, function() {
            console.log(this);
        });
    });
    });

      </script> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials