I''m not sure I totally understand your question but you can simply loop
through the parentNodes with something like this:
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
<keithdavis-mQJYS7++JhLwMB+CN6uaIQ@public.gmane.org>
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
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs