Hi David,
I posted this in reply to a similar question a couple weeks ago:
var a = $('yourNode')[0].attributes,
attrs = [];
for (i=0; i < a.length; i++) {
attrs.push(a[i].nodeName + ': ' + a[i].nodeValue);
}
console.log(attrs);
Not sure how well this will work in other browsers, but it does the
trick in Firefox. Of course, you'll need to do something other than
console.log() with the results if you're in IE.
Hope that helps get you started.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Jan 26, 2009, at 3:52 PM, David wrote:
Is there any way to use jquery to get an array of all attributes a
given node has? I'm writing some code to process a page where the
user might have added custom attribute names that I can't know about
in advance but need to detect.