Changing visibility using JavaScript

Problem: How can I change visibility (visible|hidden) of some element
(polygon, polyline...) using JavaScript (without interacting the
server)?

Purpose: I have several polygons in SVG file and I want to allow user
to hidden and again show selected polygons (polylines...) with
check/uncheck checkbox (event onChange).

Current situation: I am using MSIE 5.0 with Adobe SVG Viewer 
(latest). I have two files HTML and SVG. HTML file has checkboxes and 
planned JavaScript and floating frame (tag <iframe>), where is SVG 
file. Each polygon has its unique id.

What I do not know: How to write Java Script, which will change one of
style item (visibility) to hidden. I do not know especially how to
reffer to selected style item? I think something like (inside
function)

iframe_name.id_of_polygon.style.visibility = "hidden" 

Is it possible? I do not want to change other style items (fill,
stroke).

Thank You

Stepan Rybar

Czech Environmental Institute

Received on Tuesday, 13 June 2000 05:13:58 UTC