Get all elements?

Anonymous
06-16-2004, 01:59 PM
I'm making a html that displays a svg map with circles randomly placed.
There's a checkbox that toggles the display of the circles.
In the code to toggle, how do I loop through all the circles?
Right now the code looks like this:

var svgobj = document.embeds['theSVG'].getSVGDocument().getElementById(element_name);
if (!checkbox.checked){
// Hide layer.
svgobj.setAttributeNS(null,'visibility','hidden');
} else {
// Show layer.
svgobj.setAttributeNS(null,'visibility','visible') ;
}

This only does it for element_name. How do I loop through all of them?
Thanks!

Anonymous
06-16-2004, 02:07 PM
I found it,
I used getElementsByTagName("circle")
Thanks to the tutorials.

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum