javascript usecustom html attribute code example
Example 1: javascript get data attribute value
const article = document.querySelector('#electric-cars');
article.dataset.columns // "3"
article.dataset.indexNumber // "12314"
article.dataset.parent // "cars"
Example 2: data attribute html
<!-- data-* attritubes can be used on any html element -->
<div data-my-custom-data="true"></div>