Fixed it. The div needed style="display:block; and style="display:none; as well as to hide/show I used document.getElementById(id).style.display = 'none';anddocument.getElementById(id).style.display = 'block';