Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery if else on click

$('#myElementID').click(function() {
	var isSomethingTrue = true;
    
    if(isSomethingTrue){
    	alert("something is true");
    }else{
    	alert("something is false");
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #click
ADD COMMENT
Topic
Name
6+4 =