I’m using the below code to hide and show divs
function showSubCat(id)
{ for(var i=1; i<=12; i++)
{ var hideid = 'cat'+i;
document.getElementById(hideid).style.display = "none";
}
document.getElementById(id).style.display = "block";
}
The IDs of the div are from cat1 to cat12.
All works good, except for cat11 and cat12, they just dont show.
Any ideas?
SOLVED: Function works, the problem was in the ending tag.
Thaks.
http://jsfiddle.net/samccone/wRWeK/
works fine….