Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get all elements of an id

// You can't
// You can only have 1 instance of an id per document
// You need to use classes instead

var x = document.getElementsByClassName("example");
 
PREVIOUS NEXT
Tagged: #javascript #elements #id
ADD COMMENT
Topic
Name
5+2 =