Martínez wrote:
Is it possible to count the number of tables (or any object) inserted in a
web page using javascript ?
The getElementsByTagName method is defined for the document object node
and for element object nodes so you can do e.g.
document.getElementsByTagName('table').length
to find the number of table elements in the whole document and e.g.
someElement.getElementsByTagName('table').length
to find the number of table elements inside of a certain element.
That works in IE 5 and later, Netscape 6 and later, Opera 6 and later,
Mozilla/Firefox and should do in Safari and Konqueror too.
--
Martin Honnen
http://JavaScript.FAQTs.com/