Answers for "get element by data attribute value html"

5

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
0

js select by data attribute

$("[attribute=value]")
Posted by: Guest on December-17-2020

Code answers related to "get element by data attribute value html"

Code answers related to "Javascript"

Browse Popular Code Answers by Language