In your case, just take the code from [this answer](http://stackoverflow.com/questions/498970/how-to-trim-a-string-in-javascript/498995#498995) and have something like: `var value = document.getElementById("myInput").value; var trimmed = value.trim();`
– Shadow The GPT WizardAug 25 '11 at 10:33
1
Maybe you did not express it correctly, but trimming the value returned by `getElementbyId` does not make sense. It returns a DOM element.
– Felix KlingAug 25 '11 at 10:41