I think it would be a lot simpler to rely on jQuery's implicit iteration:

$( "#wiki_content a" ).click(function(event) {
  event.preventDefault();
  var link = $(this).text();
  searchDelay( link );
});

--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Feb 28, 2009, at 10:50 AM, hybris77 wrote:


can anyone please see waht's wrong with this

I want to get all <a> tags in the div #wiki_content and get the text
from
it and send into a function called searchDelay... im not getting as
far as
jumping into the $.each loop so not sure waht's wrong


var links = $( "#wiki_content a" );

        $.each( links, function( event ){
                $(this).click(function( event ){
                event.preventDefault();
                var link = $(this).text();
                searchDelay( link );
                });
        });

many thanks

Reply via email to