Confirm onclick

/ Published in: JavaScript
Save to your folder(s)

Ask the user with a confirmation dialog if the link should be followed or not.

Copy this code and paste it in your HTML
  1. function conf()
  2. {
  3. return confirm('Are you sure?');
  4. }
  6. <a onclick='return conf()' href=''>Link</a>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.