arne a écrit :
Hi
what would be the easiest way to find all tag's with a certain name (or
class) below (within) a certain tag.
Pref jscript DOM
thx
Arne
For links: document.links
http://www.w3.org/TR/DOM-Level-2-HTM...tml#ID-7068919
For images: document.images
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-90379117
For forms: document.forms
http://www.w3.org/TR/DOM-Level-2-HTM...tml#ID-1689064
For applets: document.applets
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-85113862
For anchors: document.anchors
http://www.w3.org/TR/DOM-Level-2-HTM...tml#ID-7577272
All these return an HTML collection.
For other elements (e.g. <p>): document.getElementsByTagName("p")
http://www.w3.org/TR/2004/REC-DOM-Le...tml#ID-A6C9094
This returns a nodelist.
There are other lists possible. Like rows, cells.
var rowCollection = document.getElementById("idTable").rows;
will return a list of row nodes.
http://www.w3.org/TR/DOM-Level-2-HTM...tml#ID-6156016
var cellCollection = rowCollection[3].cells;
will return a list of cell nodes from within the 4th row.
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-67349879
There is also the options list:
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-30606413
Within a node, you can do:
document.getElementById("section").getElementsByTa gName("p")
which would return a list of <p> nodes from within a div identified as
"section".
Gérard
--
remove blah to email me