js get html writing of an attribute and value code example
Example 1: how to get element by attribute value in javascript
document.querySelectorAll('[data-foo="value"]');
Example 2: data attribute html
<!-- data-* attritubes can be used on any html element -->
<div data-my-custom-data="true"></div>