I am trying to write a method that when invoked, changes a boolean variable to true, and when invoked again, changes the same variable to false, etc.
For example: ca
var logged_in = false;
logged_in = !logged_in;
A little example:
var logged_in = false;
$("#enable").click(function() {
logged_in = !logged_in;
checkLogin();
});
function checkLogin(){
if (logged_in)
$("#id_test").removeClass("test").addClass("test_hidde");
else
$("#id_test").removeClass("test_hidde").addClass("test");
$("#id_test").text($("#id_test").text()+', '+logged_in);
}
.test{
color: red;
font-size: 16px;
width: 100000px
}
.test_hidde{
color: #000;
font-size: 26px;
}
Some Content...