Welcome Guest, Not a member yet? Register   Sign In
Switch var from TRUE to FALSE (jQuery)
#1

[eluser]Fielder[/eluser]
If I have a jquery variable as such, how can I easily flip it.
Code:
var print = true;
I want to change the value of var print to false, without having to do if/else statement.
Code:
if (print == true)
{
    print = false;
}
else
{
    print = true;
}
Or what would be the shorthand if/else statement for it? Just looking for cleaner code for such a simple function.
#2

[eluser]BilliamTheSecond[/eluser]
print = !print;




Theme © iAndrew 2016 - Forum software by © MyBB