if else jquery click function code example
Example 1: if else jquery click function
if(jQuery('#id').click) {
//do-some-stuff
} else {
//run function2
}
Example 2: jquery if else click function
$(document).ready(function(){
var n = $("#example div").length;
if (n < 2) {
$("body").css("background", "green");
}
else {
$("body").css("background", "orange");
}
});