JS Script to remove white spaces in an Input Field

This script uses to remove white spaces in an input field after string insertion.

JS
<script language="javascript" type="text/javascript">
    function removeSpaces(string) {
        return string.split(' ').join('');
    }
</script>
HTML
<input type="text" onblur="this.value=removeSpaces(this.value);">

Note: Make sure that you have added the required files.

Leave a comment

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