[EMAIL PROTECTED] wrote:
with something like..
<img id="banner" alt="This is a banner" />

//[EMAIL PROTECTED]'banner']/@alt would return "This is a banner". Doing it this
way does not work, but is valid in XPather 
https://addons.mozilla.org/en-US/firefox/addon/1192
Is there another way to do this in JQuery (I am currently just looping
the return and extracting the attribute if set)?

jQuery supports (some) XPath for selecting things, but not the whole Spec. Try:

var alt = $('#banner').attr('alt');

Looping is pointless because an id is supposed to be unique in a document. Also I think the CSS selector syntax should be faster then your generic approach.



--Klaus

Reply via email to