tags = [];
do {
tags.push(element.tagName);
} while (element = element.parentNode)
You could also loop through the immediate children of a parent with something like this:
element = element.firstChild;
tags = [];
do {
tags.push(element.tagName);
} while (element = element.nextSibling )
There is also a collection of children nodes via the childNodes property. You could also just loop through the childNodes property collecting the tag names.
Brandon
On 6/26/06,
Keith Davis <[EMAIL PROTECTED]> wrote:
IS there a way to determine that the parent or child tags are for a given element?
_____________________
Thanks,Keith Davis - MCSA, A+, N+
P.R.I.D.E. - Director of Computer Services
www.pridedallas.com
Work (214) 351-6600 ext. 119
Mobile (214) 906-5183
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
