Answers for "get data from html data attr"

6

get data attribute javascript

// <div id="element" data-name="john"></div>

const el = document.querySelector('#element')
el.dataset.name // 'john'
Posted by: Guest on November-02-2020
-2

get data attribute javascript

Get data attribute
Posted by: Guest on June-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language