how to show confirmation alert with three buttons 'Yes' 'No' and 'Cancel' as it shows in MS Word

前端 未结 2 1242
星月不相逢
星月不相逢 2020-11-27 20:41

I\'m showing a confirmation alert box through JavaScript:

function checked() {
 if (hdnval.toLowerCase() != textbox1.toLowerCase()) {
  var save = window.con         


        
2条回答
  •  情深已故
    2020-11-27 21:39

    This cannot be done with the native javascript dialog box, but a lot of javascript libraries include more flexible dialogs. You can use something like jQuery UI's dialog box for this.

    See also these very similar questions:

    • JavaScript confirm box with custom buttons
    • custom choices in javascript confirm dialog

    Here's an example, as demonstrated in this jsFiddle:

    
        
        
        
        
        
    
    
        Click here
        
    
    

提交回复
热议问题