trim whitespace in anchor

by ian_smithz

HTML

<a class="download" target="_blank" href="http://www.home.test.com/test/redirector.jspx?        action=ref&cname=test_EDITORIAL&ckey=2448719&cc=US&lc=eng&mcr=true&cmpid=MA43304BL" style="font-weight:bold;text-decoration:none;color:
            #0085d5">       download the brochure</a>



<a class="home" itemprop="item" href="http://screwfix.aws.ie.ae.redboxcloud.com/" title="Go to Home Page">
                                Home                            </a>


<!- real code -->

                                
<div class="breadcrumbs">
        <ul itemscope="" itemtype="http://schema.org/BreadcrumbList">
                                                            <li class="home" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
                                                    <a itemprop="item" href="http://screwfix.aws.ie.ae.redboxcloud.com/" title="Go to Home Page">Home</a>
                            <meta itemprop="name" content="Home">
                            <meta itemprop="position" content="1">
                                                                            <span>/ </span>
                                            </li>
                                                                <li class="cms_page" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
                                                    <strong>Help Delivery Info</strong>
                                                                    </li>
                                    </ul>
    </div>

JavaScript

$('a.download').text($('a.download').text().trim());
$('a.home').text($('a.home').text().trim());


var tb = jQuery('.breadcrumbs li:first-child a');
jQuery(tb).text(jQuery(tb).text().trim());