Javascript remove spaces
It’s a trivial thing which is quite often needed in Javascript, a quick easy way to remove spaces. Regex is the answer.
Sure you’ve seen something similar before but useful for reference non the less. Can be used against any string but this example is used on a form input box.
<input type=“text” name“bob” onBlur=“this.value = this.value.replace(/s*/g,’);”>





