Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get element by attribute

document.querySelector('[hello="hi"]') // First element
document.querySelectorAll('[hello="hi"') // Get all elements (returns a array)
 
PREVIOUS NEXT
Tagged: #js #element #attribute
ADD COMMENT
Topic
Name
6+1 =