substring using jquery code example Example: substring from a string in jquery var subStr = str1.substring(0, 5);