jQuery Remove string from string with split() - Javascript jQuery

Javascript examples for jQuery:String

Description

jQuery Remove string from string with split()

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.5.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/* ww w  .jav  a2s.  c o m*/
var name = "username1, username2 and username3 like this post.".split(",")[1];
$("h1").text(name);
    });

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

Related Tutorials