I have below code to for toaster
toastr.success("<br /><br /><button type='button' id='confirmationRevertYes' class='btn clear'>Yes</button>",'delete item?',
{
closeButton: false,
allowHtml: true,
onShown: function (toast) {
$("#confirmationRevertYes").click(function(){
hidepanel(); // not working
this.hidepanel(); // not working
});
}
});
I have one function outside
hidepanel(){
}
When trying to call inside toaster onShown method it throws error
hidepanel does not exist on type 'HTMLElement'.
How can this work?
Thanks
Assuming you have a function call
hidepanel
, use the=>
expression