Toggle multiple divs on and off (almost working)

boitterbwon

New Member
I have this:\[code\]function toggleCharts() {var x, divArray = ["item_4746983", "item_4491867"];for (x in divArray) { if (x) { document.getElementById(divArray[x]).style.display = 'block'; }}<button onClick="toggleCharts();">Charts</button>\[/code\]and this:\[code\]#item_4746983 { display:none;}#item_4491867 { display:none;}\[/code\]\[code\]item_4746983\[/code\] & \[code\]item_4491867\[/code\] are thumbnails that I want to show or hide when you click on chartsThe code works and they display when I click the button but I can't figure out the code to hide them by clicking on it again.
 
Back
Top