
以下的事件可由 JavaScript 发生:
A blur event occurs when a text or textArea field on a form loses focus. The onBlur event handler executes JavaScript code when a blur event occurs.
xxx Examples to be supplied.
A change event occurs when a selection, text, or textArea field loses focus and its value has been modified. The onChange event handler executes JavaScript code when a change event occurs.
Use the onChange event handler to validate data after it is modified by a user.
xxx Examples to be supplied.
For button or radioButton, JavaScript code to run when a button is clicked. For checkbox, JavaScript code to run when user checks or unchecks an item.
button, checkbox, radioButton, link, reset, submit
For example, suppose you have created a JavaScript function called compute(). You can execute the compute() function when the user clicks a button by calling the function in the onClick event handler, as follows:
<INPUT TYPE="button" VALUE="Calculate" onClick="compute(this.form)">
In the above example, the keyword this refers to the current object; in this case, the Calculate button. The construct this.form refers to the form containing the button.
For another example, suppose you have created a JavaScript function called pickRandomURL() that lets you select a URL at random. You can use the onClick event handler of an anchor to dynamically specify a value for the HREF attribute of the anchor, as shown in the following example:
In the above example, the onMouseOver event handler specifies a custom message for the Navigator status bar when the user places the mouse pointer over the Go! anchor. As this example shows, you must return true to set the window.status property in the onMouseOver event handler.
Executed when input focus enters the field, either by tabbing in or by clicking but not selecting in the field.
xxx Examples to be supplied.
A load event occurs when Navigator finishes loading a window or all frames within a FRAMESET. The onLoad event handler executes JavaScript code when a load event occurs.
Use the onLoad event handler within either the <BODY> or the <FRAMESET> tag, for example, <BODY onLoad="...">.
xxx Examples to be supplied.
onUnload event handler
Executes when the mouse pointer is over an object. You must return true if you want to set the window.status property with the onMouseOver event handler.
By default, the HREF value of an anchor displays in the status bar at the bottom of the Navigator when a user places the mouse pointer over the anchor. In the following example, the onMouseOver event handler provides the custom message "Click this if you dare."
See onClick for an example of using onMouseOver when the anchor HREF attribute is set dynamically.
A select event occurs when a user selects some of the text within a text or textArea field. The onSelect event handler executes JavaScript code when a select event occurs.
xxx Examples to be supplied.
In the following example, the onSubmit event handler evaluates the data being submitted to test if it is legal. If the data is legal, the form is submitted; otherwise, the form is not submitted.
An unload event occurs when you exit a document. The onUnload event handler executes JavaScript code when an unload event occurs.
Use the onUnload event handler within either the <BODY> or the <FRAMESET> tags, for example, <BODY onUnload="...">.
xxx Examples to be supplied.
onLoad event handler
|
月光软件┊程序下载┊编程文档┊电脑教程┊网站设计┊网址导航┊网络文学┊游戏天地┊幽默笑话┊生活休闲┊写作范文┊安妮宝贝 电脑技术┊编程开发┊网络专区┊谈天说地┊情感世界┊游戏元素┊分类游戏┊热门游戏┊体育运动┊手机专区┊业余爱好┊影视沙龙 音乐天地┊数码广场┊教育园地┊科学大观┊古今纵横┊谈股论金┊人文艺术┊医学保健┊动漫图酷┊二手专区┊地方风情┊各行各业 月光软件站·版权所有 |