I am transforming and xml document. In that code I create
div class = (mydiv( and a dynamic unique number)
I can toggle these div's (expand collapse) what I need to do now is toggle them all (expand of collapse)
I don't know what these divs will be or how many until after the html code is generated. SO I need a way to use java to get the div = mydiv* and enter them in an array to use in the toggle all.
Code:
function toggle5(showHideDiv, switchImgTag) {
          var ele = document.getElementById(showHideDiv);
          var imageEle = document.getElementById(switchImgTag);

          if(ele.style.display == "block") {
          ele.style.display = "none";
          imageEle.innerHTML = '<img src="/images/expand_icon.png"/>';
          } else {
          ele.style.display = "block";
          imageEle.innerHTML = '<img src="/images/collapse_icon.png"/>';
          }
          }


<div id="contentDivImg{generate-id()}" style="display: block;"></div>