Find all elements in javascript that do not have a data- attribute
问题 I need to find all elements in $('.post-content') that do not have data attributes. I tried to say something like if (!$('.post-content p').attr('data-example')) { ... } But obviously that does not work. So how would I do the following: Find all p tags that belong to .post-content who do NOT have a data-attribute and remove them. I think its very straight forward, but all the stack questions and docs, and jquery and the internet just has "how to add, how to find, how to add a value - to the