How to remove extra space from starting and ending of a string in jQuery on 02:12 No Comments 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())); });