I am displaying a JavaScript confirm box when the user clicks on the "Delete Data" button. I am displaying it as shown in this image:
In the image, the "OK" button is selected by default. I want to select the "Cancel" button by default, so that if the user accidentally presses the enter key, the records will be safe and will not be deleted.
Is there any way in JavaScript to select the "Cancel" button by default?
If you can use jQuery plugin then here is a nice one
To change the default focused button:
$.prompt('Example 4',{ buttons: { Ok: true, Cancel: false }, focus: 1 });