jquery selecting element by data attribute

Posted by zizo on Stack Overflow See other posts from Stack Overflow or by zizo
Published on 2010-03-21T16:13:15Z Indexed on 2010/03/21 16:21 UTC
Read the original article Hit count: 296

Filed under:

Is there an easy and straight-forward method to select elements based on their data attribute? For example, select all anchors that has data attribute named customerID which has value of 22. I am kind of hesitant to use rel or other attributes to store such information, but I find it much harder to select an element based on what data is stored in it.

Thanks!

© Stack Overflow or respective owner

Related posts about jQuery