Friday, July 8, 2011

Collect all child elements javascript

For all first level children
var children = document.getElementById('id').childNodes;

For all descendants 
var children = document.getElementById('id').getElementsByTagName('*');

For some particular  element children
var childNodeArray = document.getElementById(tbody).getElementsByTagName('tr');

No comments:

Post a Comment

Contact Me for any help regarding rails/nodejs/php/mysql

Name

Email *

Message *