Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Query: JS style.height IF statement Re: Query: JS style.height IF statement

#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”;
}
}