User:Chuehloo/sandbox

A SVG
   function Change_Layer(checkbox, element_name){ // For each element, get the element's style object, then set // its visibility according to the state of the checkbox. var svgobj = document.embeds['SVG_Basic_Test'].getSVGDocument.getElementById(element_name); if (!checkbox.checked){ // Hide layer. svgobj.setAttributeNS(null,'visibility','hidden'); } else { // Show layer. svgobj.setAttributeNS(null,'visibility','visible'); }     }    

Example  Example    // Make sure all checkboxes are checked whenever the page is reloaded in the browser. for (var i = 0; i < document.Change_Layer_form.elements.length;  i++) if (document.Change_Layer_form.elements[i].type == 'checkbox'){ document.Change_Layer_form.elements[i].checked = true; }

Reference: | How do I embed SVG into HTML page