Saturday 19 November 2016

How to remove extra space from starting and ending of a string


How to remove extra space from starting and ending of a string




Simple write the following script:

jQuery('#your-form-id input[type=text]').one('keyup', function(){
        jQuery(this).val(jQuery.trim(jQuery(this).val()));
});