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
Use the replace function in js:
replace
var emailAdd = $(this).text().replace(/ /g,'');
That will remove all the spaces
If you want to remove the leading and trailing whitespace only, use the jQuery $.trim method :
var emailAdd = $.trim($(this).text());