1//javascript get html data attribute
2<button data-id="1" >Click</button>
3<button data-id="2" >Click</button>
4<button data-id="3" >Click</button>
5const btns=document.querySelectorAll('button[data-id]');
6[...btns].forEach(btn => console.log(btn.getAttribute('data-id')))
1const article = document.querySelector('#electric-cars');
2
3article.dataset.columns // "3"
4article.dataset.indexNumber // "12314"
5article.dataset.parent // "cars"