I'm using Bootstrap4C UI, and I want to cancel the checked property of a particular element after some delay time. You can see the options I have tried on next example:
$('.button_onoff').change(function()
{
console.log("pay_onoff change");
/*(1). This works! */
$(this).prop('checked',false);
/*(2). This fails! */
setTimeout(function(this) {
$(this).prop('checked',false);
}, 5000);
/*(3). This fails! */
$.wait(5000).$(this).prop('checked',false);
/*(4). This fails! */
$.wait(5000);
$(this).prop('checked',false);
/*(5). This fails! */
$(this).delay(5000).prop('checked',false);
});
How can I use the this and delay function to accomplish my goal?