redbullmarky Posted February 26, 2006 Share Posted February 26, 2006 ok before i start, just need to say that i'll be using tables for this, not divs...Hi allright then - in a situation where i have an unknown quantity of button tabs and a <TABLE> for each one, how do i cycle through a group of tables and hide them all bar one?- how do i setup the tables? (ie, name and ID)- what's the code to cycle through all the tables and hide them? ie, a nice, clean 'for' loop?in a nutshell, i know how to show/hide individual tables by referencing it by its ID and changing its style - display:none, etc, but how can i have an 'array' of tables where i can use one simple function to hide them all?hope someone can helpCheersMark Quote Link to comment https://forums.phpfreaks.com/topic/3634-tabbed-menu/ Share on other sites More sharing options...
ccl Posted March 8, 2006 Share Posted March 8, 2006 var tbls = document.getElementsByTagName("table");var i;for (i = 0; i < tbls.length; i++){ var t = tbls.item(i); t.style.display = "none";}<table style="display:block;"></table> Quote Link to comment https://forums.phpfreaks.com/topic/3634-tabbed-menu/#findComment-15614 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.