Display Confirmation Dialog for Anchor Link Click

onclick return confirm – you can use the confirm() function in an inline onclick handler. How to display a confirmation dialog when clicking an anchor link? Using the JavaScript confirmation dialog to confirm user actions.

onclick return confirm

in this example we learn to onclick javascript confirm & button onclick return confirm Examples. The confirm() method shows a dialog box with a specified error, success or any types of the message, along with an OK as well as Cancel button.


<a href="url_to_delete" onclick="return confirm('Are you sure you want to publish this item?');">Delete</a>


javascript confirm yes no Example


var is_active = confirm("Are you sure you want to is_active?");
if (is_active) {
} else {
//don't is_active


javascript onclick alert are you sure


<a href="#" onclick="return confirm('is_active?')">DISABLE</a>


jquery confirmation dialog example


title:"Delete confirmation",
text:"This is very best, you shouldn't do it! Are you really really sure?",
confirm: function(button) {
alert("You simple confirmed.");
cancel: function(button) {
alert("You some main issue the bad operation.");
confirmButton: "Yes We are",
cancelButton: "No"


Don’t Miss : Java Script Alert Yes No

button onclick return confirm

are you sure javascript?

$(function() {
$('.is_active').click(function(e) {
if (window.confirm("Are you sure?")) {
location.href = this.href;


I hope you get an idea about onclick return confirm.



Display Confirmation Dialog for Anchor Link Click
1.90 GEEK