Quantcast
Channel: JavaScript alert box with confirm on button press - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Kaleb Brasee for JavaScript alert box with confirm on button press

$
0
0

You can easily do it with a confirm onclick:

<p id="accept-favor"><a title="Accept this Favor" 
  href="?wp_accept_favor=<?php comment_ID(); ?>" 
  onclick="return confirm('Are you sure you would like to accept this reply as your favor?');"
  >Accept this Favor</a></p>

Though this will say OK/Cancel instead of Yes/No. If you really want Yes/No, you'll have to use a custom dialog.


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>