if (this..click) code example
Example: jquery if else on click
$('#myElementID').click(function() {
var isSomethingTrue = true;
if(isSomethingTrue){
alert("something is true");
}else{
alert("something is false");
}
});
$('#myElementID').click(function() {
var isSomethingTrue = true;
if(isSomethingTrue){
alert("something is true");
}else{
alert("something is false");
}
});