How to strip white space when grabbing text with jQuery

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 gen...


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 have to work with, the script as I have it and a copy of the output.

html


name@example.com




jQuery JavaScript
$(document).ready(function(){
$('div.field-field-email .field-item').each(function(){

Hot in Week

Popular

Archive

item