Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
91
rated 0 times [  95] [ 4]  / answers: 1 / hits: 55108  / 13 Years ago, thu, december 1, 2011, 12:00:00

I have written the following line in Javascript:



var eleCategory = document.getElementById(cmbCategory);


Now I want to find all elementbyClassName contained in the eleCategory element.



Is it possible with something like this?



 var eleChild = eleCategory.getElementByClassName(autoDropdown);


How can I get the child element of the parent element?


More From » javascript

 Answers
52

getElementsByClassName hasn't been implemented in all browsers. Niels' solution, for instance, doesn't work in IE. However, others have created their own implementation; John Resig has a write-up on his blog


[#88812] Tuesday, November 29, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lesli

Total Points: 348
Total Questions: 105
Total Answers: 119

Location: United States Minor Outlying Island
Member since Fri, Jan 6, 2023
1 Year ago
;