jquery get attributes

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-06-06T15:11:04Z Indexed on 2010/06/06 15:12 UTC
Read the original article Hit count: 314

Filed under:
|

I'm looking for a way to grab the custom attributes of a element with jquery.

<span id='element' data-type='foo' data-sort='bar'></span>

I'm looking to get: `["data-type", "data-sort"]` as an array.

Anyone know how to do this?

Thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about attributes