Mega Code Archive

 
Categories / JavaScript Tutorial / String
 

Get the substring out of a string

< html> <head> <title>A Simple Page</title> <script language="JavaScript"> <!-- inpTxt = "Hello there"; alert(inpTxt.substring(0, 5)); //  --> </script> </head> <body> </body> </html>