substr() javascript method extracts characters from a string. Here is working example for substr function. solved issue, substr not working in IE browser

substr not working in IE browser – issue solved

substr not working in IE browser - issue solved

substr not working in IE browser – issue solved

var str="Hello world!";
document.write(str.substr(3)+"<br />");


This function works with following browser.

  • Firefox
  • Safari
  • Opera
  • google chrome

There is issue with IE browser. Do not use the substr javascript method – this function is not working in IE 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.

<script type="text/javascript">

 var str="Hello world!";
 document.write(str.substring(3)+"<br />");


Written by WPAPI

My name is Purab Kharat, Here is my Personal Blog: Work as an Senior Technical Lead at Smartsourcing Global Pvt Ltd in Princeton, NJ, USA. I contributor of many wordpress plugins and Drupal Modules. I am core developer of Drupal. Connect to purab on LinkedIn or Follow @purab on Twitter or Follow me on Google+ or Write Mail to or Chat with me on Skype : purabdk

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>