I want to have a div element set to not be clickable and then set it to clickable after another element is clicked.
So, when .case is clicked:
$(\'.case\
Depending on your need (Only one element or many, dynamic element creation or not) you can use :
1) A variable to check if the first click on the other element has been done
var isActive = false;
$('.case').click(function() {
isActive = true;
});
$('#patient').click(function(){
if(isActive === false)
return false;
//Your behaviour
});
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