Confirm box in javascript: Are you sure you want to delete?

We’ve been there. To click by mistake a link or a button which deletes an information and not to be asked if I am sure I want to do it. And there goes my work… one second of not paying attention…

So, why not make in our pages, on those links that are important, an intermediary step (a confirm box) in which people get to be asked if they are sure on the actions they are about to make?

And all is made with a simple javascript code inside the “a href” tag:

You could, ofcourse, make it a bit more complex like this…

Leave a Reply

Your email address will not be published. Required fields are marked *

No spam? * Time limit is exhausted. Please reload CAPTCHA.