Posted By

gummiost on 11/16/12


Tagged

link confirm onclick


Versions (?)

Confirm onclick


 / Published in: JavaScript
 

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

  1. function conf()
  2. {
  3. return confirm('Are you sure?');
  4. }
  5.  
  6. <a onclick='return conf()' href='http://example.com'>Link</a>

Report this snippet  

You need to login to post a comment.