SyntaxFix
Write A Post
Hire A Developer
Questions
Probably because you forgot to implement the solution in the accepted answer. That's the code that makes trim() work.
trim()
update
This answer only applies to older browsers. Newer browsers apparently support trim() natively.