In an attempt to solve a similar situation I've come across this example and adapted it. It uses JQUERY UI Dialog as Nikhil D suggested. Here is a look at the code:

HTML:

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
<input type="button" id="box" value="Confirm the thing?" />
<div id="dialog-confirm"></div>

JavaScript:

$('#box').click(function buttonAction() {
  $("#dialog-confirm").html("Do you want to do the thing?");

  // Define the Dialog and its properties.
  $("#dialog-confirm").dialog({
    resizable: false,
    modal: true,
    title: "Do the thing?",
    height: 250,
    width: 400,
    buttons: {
      "Yes": function() {
        $(this).dialog('close');
        alert("Yes, do the thing");
      },
      "No": function() {
        $(this).dialog('close');
        alert("Nope, don't do the thing");
      }
    }
  });
});

$('#box').click(buttonAction);

I have a few more tweaks I need to do to make this example work for my application. Will update this if I see it fit into the answer. Hope this helps someone.

Answer from FredFury on Stack Overflow
🌐
Envato Tuts+
code.tutsplus.com › home › coding fundamentals
Confirm Yes or No With JavaScript | Envato Tuts+ - Code
July 21, 2021 - In a dialog box, there are two buttons: OK and Cancel. If a user clicks on the OK button, the confirm method returns true, and if a user clicks on the cancel button, the confirm method returns false.
🌐
ASPSnippets
aspsnippets.com › questions › 336364 › Confirm-dialog-with-Yes-No-Button-instead-of-OK-and-Cancel-in-ASPNet
Confirm dialog with Yes No Button instead of OK and Cancel in ASPNet
November 30, 2016 - I need to display a message in button click with yes no button ..But pop up shows ok,cancel button. <script type = "text/javascript"> function Confirm() { var confirm_value = document.createElement("INPUT"); confirm_value.type = "hidden"; confirm_value.name = "confirm_value"; if (confirm("Are you sure, you want to Close BOM?")) { confirm_value.value = "Yes"; } else { confirm_value.value = "No"; } document.forms[0].appendChild(confirm_value); } </script>
🌐
Salesforce
trailhead.salesforce.com › trailblazer-community › feed › 0D54V00007T4MbJSAV
Yes No Button Instead of ok cancel in "Confirm" - Trailhead
Skip to main content · Scheduled Maintenance: Trailhead, myTrailhead, and Trailblazer Community will be offline January 17, 16:00–20:00 UTC. Thanks for bearing with us as we update your experience
Find elsewhere
🌐
WebDeveloper.com
webdeveloper.com › community › 73124-javascript-instead-of-okcancel-confirmation-box-how-to-use-yesno
Javascript instead of Ok/Cancel Confirmation box how to use Yes/No
<script language="javascript" ... OnClick="btnOk_Click" Text="OK" /> Write the btnOk_Click event in your server side code protected void btnOk_Click(object sender, EventArgs e) { // your code } Now your confirmation dialog will ...
🌐
sebhastian
sebhastian.com › javascript-confirmation-yes-no
JavaScript - Create confirmation box with yes and no options | sebhastian
July 6, 2022 - You can create a JavaScript confirmation box that offers yes and no options by using the confirm() method. The confirm() method will display a dialog box with a custom message that you can specify as its argument.
🌐
Microsoft Learn
learn.microsoft.com › en-us › archive › msdn-technet-forums › 8a739fd2-2a9d-4720-a59d-854ca4452d0c
Javascript Confirm popup Yes, No button instead of OK and Cancel? | Microsoft Learn
MainPage.HTML (From where the confirmation dialog will be shown. In your case, u can use the script in this html and customize it according to ur needs) <!DOCTYPE> <html> <head> <title>Main Page</title> <script language="javascript" type="text/javascript"> function showConfirmDlg(message) { var returnValue = window.showModalDialog("dialog.html",message,"dialogHeight:150px;dialogWidth:200px"); if ( returnValue == 'yes' ) alert('Yes button is clicked in the dialog'); else alert('No button is clicked in the dialog'); } </script> </head> <body> <input id="btnConfirm" type="button" value="Confirm" onclick="javascript:showConfirmDlg('Do you want to continue?');" /> </body> </html>
🌐
W3Schools
w3schools.com › jsref › met_win_confirm.asp
Window confirm() Method
let text; if (confirm("Press a button!") == true) { text = "You pressed OK!"; } else { text = "You canceled!"; } Try it Yourself » ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: ...
🌐
Microsoft
social.msdn.microsoft.com › Forums › en-US › 228345cb-e490-4d70-b04e-334599f0b128 › yes-no-instead-of-okcancel-for-confirm
Yes/ No instead of Ok/Cancel for Confirm - MSDN - Microsoft
November 20, 2021 - <script language=javascript> /*@cc_on @*/ /*@if (@_win32 && @_jscript_version>=5) function window.confirm(str) { execScript('n = msgbox("'+str+'","4132")', "vbscript"); return(n == 6); } @end @*/ var r = confirm("Can you do it?"); alert(r); </script>
🌐
EyeHunts
tutorial.eyehunts.com › home › confirm box in javascript with yes no option
Confirm box in JavaScript with yes no option
March 26, 2024 - Another way to confirm yes or no is with a hidden div on your page. <main> <h1>Delete Profile</h1> <p>Click on the following button to delete your profile from our website permanently, this action can not be undone </p> <button onclick="res...