I am trying to disable click event and disable div once I click on the item. I am unable to achieve this functionality. Any help? What I have tried
<div class="ordrClone">
Image 1
</div>
<div class="ordrClone">
Image 2
</div>
<div class="ordrClone">
Image 3
</div>
<div>
<input type="button" id= "btnCancel" value="Enable">
</div>
$('.ordrClone').click(function () {
$('.ordrClone').not(this).each(function() {
$(this).off('click');
});
});
$('#btnCancel').click(function () {
$('.ordrClone').each(function() {
$(this).on('click');
});
});