开发者

javascript confirmation box

In javascript,guide me to display a开发者_运维知识库 confirm box with button such as "Yes" and "No" instead of "Ok" and "Cancel".

thanks in advance...


The button text in the "confirm" box is dependent on the browser local. There's no way to change them. There is no easy way to create a popup fully in javascript with the same functionality.

If you're using jQuery, you can have a look at this modal confirmation dialog example.

Otherwise, I advise to reformulate the question and stick with the javascript "confirm" box.


suppose you say var x=confirm("Do you want to continue");

You can't. The look and the buttons of the JavaScript alert, confirm and prompt boxes are controlled strictly by the browser's type and version and by the Operating System.

Well it is true that you may create, graphically, a div which could look like and create a code to make it act almost like a confirm box, case in which you may design whichever buttons you want. But you will never be able to make it work in the same synchronous manner as a real confirm box, which means you will miss the main functionality of a confirm.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜