JS常见事件及其对应函数
2016-06-22 16:33
633 查看
JS常见事件及其对应函数如下图所示: 代码详例:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> Event_Page </title> <link rel="stylesheet" type="text/css" href="eve01.css"> </head> <body onload="onload_Fun(this)"> <button onclick="onc()"> 按钮 </button> <script> function onc(){ alert("on_clik_" +"event"); } </script> <!-- this 指向 函数--> <div class="div" onmouseover="on_Over_Fun(this)" onmouseout="on_Out_Fun(this)"></div> <script> <!-- 鼠标 移入 移出 事件 --> function on_Out_Fun(ooj){ ooj.innerHTML = "Out Function"; } function on_Over_Fun(ooj){ ooj.innerHTML = "Over Function"; } </script> <form> <input type="text" onchange="change_Fun(this)"> <input type="text" onselect="select_Fun(this)" onfocus="focus_Fun(this)"> </form> <script> <!-- 文本框 内容 改变 事件 --> function change_Fun(bg){ alert("Change Func !"); } <!-- 文本框 内容 选中 事件 --> function select_Fun(bg){ bg.style.background="red"; } <!-- 文本框 选中 事件 --> function focus_Fun(bg){ bg.style.background="blue"; } <!-- 网页加载完毕 事件 --> function onload_Fun(bg){ alert("网页加载完毕!"); } </script> </body> </html>
相关文章推荐
- 实例区别onClick和onDBClick两事件方法
- js触发onchange事件的方法说明
- js中的onchange和onpropertychange (onchange无效的解决方法)
- A标签触发onclick事件而不跳转的多种解决方法
- IE的fireEvent方法概述及应用
- A标签中通过href和onclick传递的this对象实现思路
- JS在onclientclick里如何控制onclick的执行
- onclick与listeners的执行先后问题详细解剖
- js函数中onmousedown和onclick的区别和联系探讨
- JavaScript获取onclick、onchange等事件值的代码
- $("").click与onclick的区别示例介绍
- 关于asp.net button按钮的OnClick和OnClientClick事件
- jsp中select的onchange事件用法实例
- JS中onpropertychange和onchange事件区别小结
- javascript option onclick事件ie解决方案 兼容ie,firefox
- 兼容firefox的给每一个onClick再附加一个事件
- onmouseover和onmouseout的一些问题思考
- javascript 动态改变onclick事件触发函数代码
- onclick ondblclick事件共存的方法
- 定义一个简单的移动端轻击事件方法tap