Hello,
I'm using this script to toggle between div's from a drop down select action. Is there a way I can expand this script to allow me to toggle with other divs?
Script:
HTML:Code:<script type='text/javascript'> function toggleSubmit(obj){ count=0 while(document.getElementById("d"+count)){ document.getElementById("d"+count).style.display="none" count++ } document.getElementById("d"+obj.selectedIndex).style.display="block" } </script>
I tried adding div's with id's of d2 and d3, but no luck...Code:<form> <select onChange="toggleSubmit(this)"> <option>AAA</option> <option>BBB</option> </select> </form> <div id="d0" style="display:block"> AAA </div> <div id="d1" style="display:none"> BBB </div>
Thank you for the help.



Reply With Quote

Bookmarks