Home › Forums › JavaScript › Query: JS style.height IF statement › Re: Query: JS style.height IF statement
July 16, 2013 at 12:47 pm
#143145
Kuzyo
Participant
function expandNav()
{
var nav = document.getElementById(“navBar”);
if (nav.style.height == “31px”) // you have to comparing == , not assigning =
{
nav.style.height = “150px”;
}
else
{
nav.style.height = “31px”;
}
}