var str="Hello world!"; document.write(str.substr(3)+"<br />"); document.write(str.substr(3,4)); </script>
This function works with following browser.
You need to use the substring() method. This is similar to substr. You can achieve your work by using this method.
Following is the working example of substring method.