当前位置: 首页 > 网络学院 > 客户端脚本教程 > JavaScript > JS事件参考

JavaScript
JS 介绍
JS 怎样使用
JS 在哪使用
JS 变量
JS If...Else
JS Switch
JS 操作符
JS Popup Boxes
JS 函数
JS For 循环
JS While 循环
JS Break 循环
JS For...In
JS 事件
JS Try...Catch
JS Throw
JS onerror
JS 特殊字符
JS Guidelines
JS 对象介绍

JavaScript 中的 JS事件参考


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

Events are normally used in combination with functions, and the function will not be executed before the event occurs!
事件一般和函数是混合使用的,在事件发生以前一般函数是不会执行的!


Event Handlers
事件的处理

New to HTML 4.0 was 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 the attributes that can be inserted into HTML tags to define event actions.
HTML4.0的新属性就是可以在浏览器中激发HTML事件。当用户点击一个一个HTML元素时,可以激发JS。下面的列表列举了可以插入HTML标签中来定义事件动作的属性。

FF: Firefox, N: Netscape, IE: Internet Explorer
FF:火狐,N:网景,IE

Attribute
属性
The event occurs when...
事件发生时机
FF N IE
onabort Loading of an image is interrupted
图片下载被打断时
1 3 4
onblur An element loses focus
元素失去焦点时
1 2 3
onchange The content of a field changes
框内容改变时
1 2 3
onclick Mouse clicks an object
鼠标点击一个对象时
1 2 3
ondblclick Mouse double-clicks an object
鼠标双击一个对象时
1 4 4
onerror An error occurs when loading a document or an image
当加载文档或图片时发生错误时
1 3 4
onfocus An element gets focus
当元素获取焦点时
1 2 3
onkeydown A keyboard key is pressed
按下键盘按键时
1 4 3
onkeypress A keyboard key is pressed or held down
按下或按住键盘按键时
1 4 3
onkeyup A keyboard key is released
放开键盘按键时
1 4 3
onload A page or an image is finished loading
页面或图片加载完成时
1 2 3
onmousedown A mouse button is pressed
鼠标被按下时
1 4 4
onmousemove The mouse is moved
鼠标被移动时
1 6 3
onmouseout The mouse is moved off an element
鼠标离开元素时
1 4 4
onmouseover The mouse is moved over an element
鼠标经过元素时
1 2 3
onmouseup A mouse button is released
释放鼠标按键时
1 4 4
onreset The reset button is clicked
重新点击鼠标按键时
1 3 4
onresize A window or frame is resized
当窗口或框架被重新定义尺寸时
1 4 4
onselect Text is selected
文本被选择时
1 2 3
onsubmit The submit button is clicked
点击提交按钮时
1 2 3
onunload The user exits the page
用户离开页面时
1 2 3

评论 (0) All

登陆 | 还没注册?