Select by default the "Cancel" in the alert

2

As everyone knows, the JS Confirmation will show a alert with the text entered and the CANCEL and OK strong>. And right away, OK is always selected and this in turn disturbs (in my case at least). Is it possible to keep the CANCEL selected instead of OK ?

    
asked by anonymous 05.11.2014 / 11:59

3 answers

2

You can use this plugin

link

And make such code.

$.prompt('Example 4',{ buttons: { Ok: true, Cancel: false }, focus: 1 });

Source

link

    
05.11.2014 / 12:48
1

Friend this is not possible with javascript. In this case I suggest you create your own popUp. The bootstrap provides nice alerts that are simple to implement.

link

    
05.11.2014 / 12:58
1

You can not do this. The focus of the default option is OK. Instead of confirm you can use the library below.

link

In addition to solving your problem, it improves the usability of your site, since it produces something more friendly.

    
05.11.2014 / 13:05