Simple way to trim whitespace for the beginning of text using JavaScript.
1 2 3 4 |
var keywordvalue = " Hi "; var keywordvalue = (keywordvalue.trimLeft()); |
Output = “Hi ”
To replace all whitespace using Javascript use this next script.
http://aq.gthex.co.uk:10000/javascript/trim-whitespace-javascript/