Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Access child elements of a main element js

var listElement = document.getElementById("element");

// could also use listElement.children;
var listElements = listElement.getElementsByTagName('div'); 

for (i = 0; i < listElements.length; i++) {
  alert(listElements[i].id);
}
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #Access #child #elements #main #element #js
ADD COMMENT
Topic
Name
1+9 =