I have the following HTML:
<div id="Root">
<div class="sub">
<button data-help-id="104" class="btn btn-primary">Select 1</button>
<button data-help-id="122" class="btn btn-default">Select 2</button>
</div>
</div>
I would like to select all the elements that have the jQuery data key "help-id" (data-help-id in the element markup). This is irregardless of the value of the attribute.
This data attribute may be applied to many different elements - div's, span's, etc, so merely selecting the buttons will not work. I do not want to go to the additional effort of adding a specific class name to these elements either.
I did see this post: Find all elements that have a certain data attribute (regardless of value) - however, I am not selecting a group of elements which to filter on first. I wanted this to be as lightweight as possible - and simply have the selector run on page load so that it can do the DOM manipulation.
Is this possible?