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

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


im trying to add a class to link elements that point to an external
page, using indexOf("http://") on the href attribute to see if they
are internal or external links. im using the line below, but it gives
an error probably cause of invalid syntax.
$("a").attr("href").indexOf("http://")
if i use var linksHref = $("a").attr("href") it only gets the href
value of the first link, not all of them. im looping through all links
to check if indexOf("http://") is == 0, if so -> add the class, if
not, don't
perhaps not the best technique to mark external link, but it's just a
learning excercise for me. is there a way to grab ALL href attibutes
on the page?