Use JavaScript to Get User Confirmation To Proceed

I need to confirm that the user really want to perform the action. suppose i have a function to eraseall()

onclick of button i want to say:”Do you really want to erase all?” Then call the eraseall() if they say yes.

if (confirm("Do you really want to erase all?")) { eraseall();}

Leave a Reply