I used the following code to disable the onclick event . present code
function moveToDeckTable(game_table_id,category_id,status){
var_game_table_id=game_table_id;
var redirect="table.php";
$.ajax({
type: "POST",
dataType: "json",
url: "ahr/addPlayer.php",
data: {game_table_id:game_table_id,status:status},
cache: false,
success: function(data){
if(data.success==1){
PlayingStatus =setInterval(setPlayingStatus,1000);
open_game_window = window.open(redirect+"?id="+data.game_table_id,"","_blank");
}
else if(data.success==0)
alert("User already playing..");
else if(data.success==2)
alert("You have not enough coins to play in this table .buy more coins or play in minor coins table.");
}
});
//code to disable onclick
}
function setPlayingStatus(){
if(open_game_window.closed){
$.ajax({
type: "POST",
dataType: "json",
url: "ahr/setPlayingStatus.php",
cache: false,
success: function(data)
{
clearInterval(PlayingStatus);
}
});
//code to re enable onclick
}
}
Now , I want to enable that event again on another button click. How can I enable the onclick event?


onclickor$(ele).on('click')?