语法 onClick="handlerText" 参数
使用的事件属性
描述 For checkboxes, links, radio buttons, reset buttons, and submit buttons, onClick can return false to cancel the action normally associated with a click event. For example, the following code creates a link that, when clicked, displays a confirm dialog box. If the user clicks the link and then chooses cancel, the page specified by the link is not loaded. <A HREF = "http://home.netscape.com/" onClick="return confirm('Load Netscape home page?')">Netscape</A> If the event handler returns false, the default action of the object is canceled as follows:
Buttons--no default action; nothing is canceled
Radio buttons and checkboxes--nothing is set
Submit buttons--form is not submitted
Reset buttons--form is not reset
Note In Navigator 3.0, on some platforms, returning false in an onClick事件适用对象a reset button has no effect.
要获得关于事件对象的信息,请看事件。
回页面顶部