[jQuery] Re: grabbing all href attribute values on the page - how?

2007-05-11 Thread Kenneth
It looks like you've already worked this out, but another method to do this would be to use the document.links object. It would go something like this: $(document.links).filter(function() { return this.indexOf('http://') == 0; }).addClass('external') On 5/10/07, stef <[EMAIL PROTECTED]> wrote:

[jQuery] Re: grabbing all href attribute values on the page - how?

2007-05-10 Thread Erik Beeson
The first one is probably more "correct". It's "all a tags whose href attribute starts with http://";, which is exactly what you asked for. --Erik On 5/10/07, stef <[EMAIL PROTECTED]> wrote: your second solution worked perfectly, didnt try the first one. thanks!! On May 10, 3:10 pm, "Erik B

[jQuery] Re: grabbing all href attribute values on the page - how?

2007-05-10 Thread stef
your second solution worked perfectly, didnt try the first one. thanks!! On May 10, 3:10 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > Untested (and I haven't slept in a while): > > $('[EMAIL PROTECTED]"http://";]').addClass('external'); > > Or more along the lines of what you were doing before:

[jQuery] Re: grabbing all href attribute values on the page - how?

2007-05-10 Thread Erik Beeson
Untested (and I haven't slept in a while): $('[EMAIL PROTECTED]"http://";]').addClass('external'); Or more along the lines of what you were doing before: $('a').filter(function() { return this.href.indexOf('http://') == 0; }).addClass('external'); --Erik On 5/10/07, stef <[EMAIL PROTECTED]>