confirm怎样设置默认焦点?

boyu_song 2006-09-12 09:05:19
如题,默认焦点是确认,怎么把它设成取消为默认焦点呢?
...全文
357 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Dog2Cat 2006-09-13
  • 打赏
  • 举报
回复

Window.confirm( ) ask a yes-or-no question

--------------------------------------------------------------------------------


Availability
JavaScript 1.0

Synopsis
window.confirm(question)


Arguments
question
The plain text (not HTML) string to be displayed in the dialog box. It should generally express a question you want the user to answer.

Returns
true if the user clicks the OK button; false if the user clicks the Cancel button.

Description
The confirm( ) method displays the specified question in a dialog box that pops up over window. The appearance of the dialog box is platform-dependent, but it generally contains graphics that indicate that the user is being asked a question. The dialog box contains OK and Cancel buttons that the user can use to answer the question. If the user clicks the OK button, confirm( ) returns true. If the user clicks Cancel, confirm( ) returns false.

The dialog box that is displayed by the confirm( ) method is modal -- that is, it blocks all user input to the main browser window until the user dismisses the dialog box by clicking on the OK or Cancel buttons. Since this method returns a value depending on the user's response to the dialog box, JavaScript execution pauses in the call to confirm( ), and subsequent statements are not executed until the user responds to the dialog box.

Usage
Note that the question displayed in the dialog box is a string of plain text, not formatted HTML. You can use the newline character, "\n", in your strings to break your question across multiple lines. You can also do some rudimentary formatting using spaces and can approximate horizontal rules with underscore characters, but the results depend greatly on the font used in the dialog box and thus are system-dependent.

Also, there is no way to change the labels that appear in the buttons of the dialog box (to make them read Yes and No, for example). Therefore, you should take care to phrase your question or message in such a way that OK and Cancel are suitable responses.

See Also
Window.alert( ), Window.prompt( )


这是js文档上写的。好像控制不了。
boyu_song 2006-09-12
  • 打赏
  • 举报
回复
阿?
dreamover 2006-09-12
  • 打赏
  • 举报
回复
好像实现不了
boyu_song 2006-09-12
  • 打赏
  • 举报
回复
怎么没人?
boyu_song 2006-09-12
  • 打赏
  • 举报
回复
......
boyu_song 2006-09-12
  • 打赏
  • 举报
回复
没人会阿?

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧