I\'m wanting to use jQuery to wrap a mailto: anchor around an email address, but it\'s also grabbing the whitepace that the CMS is generating.
Here\'s the HTML I hav
Javascript has built in trim:
str.trim()
It doesn't work in IE8. If you have to support older browsers, use Tuxmentat's or Paul's answer.