I'm trying to make a simple tree menu script to contract and expand certain tables & rows. However, it's telling me that it has an invalid ID specified. Here is what I'm doing:
Code:<img src="collapse.gif" onclick="hideshow('pop',this);" style="cursor: hand; display: ''; float: right;" />Code:<tbody id="pop" style="display: block;">...table rows etc etc...</tbody>What am I doing wrong?Code:function hideshow(id, imgthis) { if(document.getElementById(id).style.display == "block" || document.getElementById(id).style.display == "") { document.getElementById(id).style.display = "hidden"; imgthis.src="collapse_collapsed.gif"; } else if(document.getElementById(id).style.display == "hidden") { document.getElementById(id).style.display = ""; imgthis.src="collapse.gif"; } }



Reply With Quote



Bookmarks