Jquery: Extracting the hrefs from multiple links on a page
<p>I discovered that .attr() only applies to the first matched element on the page! So, I've been trying to get the hrefs from all the matched elements on a page, but to no avail. </p>

<p>Here's what I tentatively wrote:</p>

<pre><code>    var thelinks = $("td a").each(function(){
    $(this).attr("href");
    document.write(thelinks);
});
</code></pre>

<p>I used document.write just to see what was going on, and I got a long list of "undefinedundefinedundefined"</p>

<p>What I'm trying to do is extract the hrefs from each td a and then use ajax to visit those pages and do other stuff. I can get it work fine when it's dealing with just one link, but this multiple elements thing I can't figure out.</p>

<p>Any help rendered is appreciated, I'm a novice to the world of Javascript and Jquery.</p>
