how to use trim() function in IE below version

Use this function in head section of your webpage and then use trim() function.

if(typeof String.prototype.trim !== ‘function’) {
  String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, ”);
  }
}


Comments

Leave a Reply

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