开发者

Javascript - How many arguments are there for confirm?

开发者 https://www.devze.com 2023-01-07 16:18 出处:网络
How many arguments are there for confirm box? What does var del=confirm(\"Are you sure?\",\"Delete\",\"开发者_开发百科\"); mean?It has a single argument which represents the text. In your example the

How many arguments are there for confirm box?

What does var del=confirm("Are you sure?","Delete","开发者_开发百科"); mean?


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.


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


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


confirm accepts only one argument:

var ans=confirm('Your message');

It will display your message with OK and Cancel buttons.

0

精彩评论

暂无评论...
验证码 换一张
取 消