I am trying to create a function that will be executed by clicking, provided that the variable is set to 0;
However, the function will not execute even if the variable is set to 0. (I use jquery)
var menuVisible = 0 ;
$('#links').click(function(){
if (menuVisible = 0)
{
$('#subMenu').show("slow") ;
menuVisible = 1 ;
}
});
I am testing the value of the "MenuVisible" variable with a warning, and it really is "0". So why the function will not execute?
source
share