my html
<span class="input-group-text">
<button type="button" class="btn btn-outline-danger btn-sm owner_button owner_check" name="owner_check" >
<i class="far fa-check-circle"></i>
</button>
</span>
my javascript
$(".owner_check").click(function(e){
e.preventDefault();
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function($get) {
$('.owner_button').removeClass('owner_check');
}
}
when I click the button once, shows the class owner_check is disappear on html code,but I still can click the button again. why? I want to disable the button function but not get success.
And how can I write a button to reset the click function again? if I use
$('owner_check).on('click',function(e){
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function($get) {
$('.owner_check').off('click');
}
}
})
$('.reset_button').on('click',fucntion(e){
$('owner_check').on('click',function(e){
/* write long ajax code again?? */
})
})