Depending on your need (only one or several elements of a dynamic element or not), you can use:
1) Variable to check if the first click on another item is done
var isActive = false; $('.case').click(function() { isActive = true; }); $('#patient').click(function(){ if(isActive === false) return false;
2) Define the click function in the click event of the first element
$('.case').on('click',function() { //Make element clickable $('#patient').on('click',function(){ //Your behaviour }); });
Then you can use off to remove the click event
sdespont
source share