Jquery select all elements that contain the data-id attribute [duplicate]

0
Hello, I would like to know if there is any way to find all elements on a page that contain the data-id attribute, just like I can when I want to get a native HTML tag. for example, if I run in the DOM of Google Chrome the code $('div') it lists me all the elements in the document and that are div tag.

Is there any code similar to $('[data-id=*]') ?

    
asked by anonymous 24.03.2015 / 18:17

1 answer

0

I ended up testing, and found that if you run the code by looking for the attribute without reference to the attribute value, it returns all elements that contain that attribute, like: $('[data-id]')

    
24.03.2015 / 18:17