当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML 事件

HTML
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML 属性
HTML 事件
HTML URL-encode
HTML Web服务器
HTML 摘要
HTML 实例
标签列表
标准属性
事件属性
ASCII码
特殊字符
HTTP状态消息

HTML 事件


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 595 ::
收藏到网摘: n/a

New to HTML 4.0 is the ability to let HTML events trigger actions in the browser, like starting a JavaScript when a user clicks on an HTML element. Below is a list of attributes that can be inserted into HTML tags to define event actions.
HTML4.0的新特征让其能在浏览器中使用HTML事件触发,像用户点击HTML元素时就能开始一个JavaScript。下面是一列可以插入HTML标签中的属性来定义事件行为。

If you want to learn more about programming with these events, you should study our JavaScript tutorial .
如果你想学有关这些元素事件的更多程序。你可以学习JavaScript 教程


Window Events
窗口事件

Only valid in body and frameset elements.
只在body和frameset元素中才有效

Attribute
属性
Value
Description
描述
onload script Script to be run when a document loads
装载时
onunload script Script to be run when a document unloads
卸载时

 


Form Element Events
表单元素事件

Only valid in form elements.
在表单元素中才有效。

Attribute
属性
Value
Description
描述
onchange script Script to be run when the element changes
当元素有改变时脚本会执行
onsubmit script Script to be run when the form is submitted
当表单提交时...
onreset script Script to be run when the form is reset
当表单重置时...
onselect script  Script to be run when the element is selected
元素被选中时...
onblur script  Script to be run when the element loses focus
元素失去焦点时...
onfocus script  Script to be run when the element gets focus
元素得到焦点时...

 


Keyboard Events
键盘事件

Not valid in base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
在 base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style,和 title 元素里都无效.

Attribute
属性
Value
Description
描述
onkeydown script  What to do when key is pressed
当键按下时做什么
onkeypress script  What to do when key is pressed and released
当键按下然后释放时做什么
onkeyup script  What to do when key is released
当键释放时做什么

 


Mouse Events
鼠标事件

Not valid in base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, title elements.
在 base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style,和 title 元素里都无效.

Attribute
属性
Value
Description
描述
onclick script  What to do on a mouse click
单击时...
ondblclick script  What to do on a mouse double-click
双击时...
onmousedown script  What to do when mouse button is pressed
按下时...
onmousemove script  What to do when mouse pointer moves
移动时...
onmouseout script What to do when mouse pointer moves out of an element
鼠标移开元素时
onmouseover script What to do when mouse pointer moves over an element
鼠标在元素上方时
onmouseup script  What to do when mouse button is released
鼠标释放时

评论 (0) All

登陆 | 还没注册?