Get sub string (substr())
<html> <body> <button onclick="var myS = new String('www.java2s.com'); alert(myS.substr(4,7));"> substr </button> </body> </html>