views:

71

answers:

3

How many arguments are there for confirm box? What does var del=confirm("Are you sure?","Delete",""); means?

+6  A: 

It has a single argument which represents the text. In your example the last two arguments will be ignored. I suppose it is a failed attempt to personalize the buttons.

Darin Dimitrov
It's perhaps interesting to know that `confirm` is part of "DOM Level 0", so not actually part of any standard. So it's quite possible that there do exist browsers that use additional parameters to customize the text on the buttons. But none that I'm aware of do...
Dean Harding
@Dean, great remark, thanks.
Darin Dimitrov
+2  A: 

Only the first is meaningful. Any subsequent ones are ignored.

Malvolio
+1  A: 

use this only ....

var del=confirm("Are you sure?");

else must be ignored.....this is the default feature in confirm box... that show "ok" and "cancel" by its own

and this will return true..if "ok" clicked.. and rteurn false...if "cancel " clicked

Richa