Dom事件02
来源:互联网 发布:linux系统分区详解 编辑:程序博客网 时间:2024/05/22 17:21
<!DOCTYPE html>
<html>
<head>
<title>dom事件03.html</title>
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript">
//onload 当页面加载完成时触发
</script>
</head>
<body onload="alert('welcome!')">
<input type="text" id="one" />
</body>
<html>
<head>
<title>dom事件03.html</title>
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript">
//onload 当页面加载完成时触发
</script>
</head>
<body onload="alert('welcome!')">
<input type="text" id="one" />
</body>
</html>
<------------------------------鼠标事件---------------------------------------->
<!DOCTYPE html>
<html>
<head>
<title>dom事件04.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<html>
<head>
<title>dom事件04.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css" >
div {
border: 1px red solid;
height: 300px;
width:300px;
}
div {
border: 1px red solid;
height: 300px;
width:300px;
}
</style>
</head>
<body >
<div id="one">
</div>
</body>
<script type="text/javascript">
/*
onmousedown 鼠标按键被按下
onmouseup 鼠标按键被松开
onmouseseout 鼠标从某元素移开
onmouseover 鼠标移到某元素之上
onmousemove 鼠标被移动 */
var one = document.getElementById("one");
/* one.onmousedown = function(event){
alert(event.button); //返回值:(左键)0 (中键) 1 (右键) 2
} */
/* one.onmouseout = function(event){
alert("onmouseout");
}
one.onmouseover = function(event){
alert("onmouseover");
} */
/* one.onmousemove = function(event){
alert("onmousemove")
} */
<div id="one">
</div>
</body>
<script type="text/javascript">
/*
onmousedown 鼠标按键被按下
onmouseup 鼠标按键被松开
onmouseseout 鼠标从某元素移开
onmouseover 鼠标移到某元素之上
onmousemove 鼠标被移动 */
var one = document.getElementById("one");
/* one.onmousedown = function(event){
alert(event.button); //返回值:(左键)0 (中键) 1 (右键) 2
} */
/* one.onmouseout = function(event){
alert("onmouseout");
}
one.onmouseover = function(event){
alert("onmouseover");
} */
/* one.onmousemove = function(event){
alert("onmousemove")
} */
one.onmousemove = function(event){
alert(event.clientX+"==>"+event.clientY);
} //获得鼠标的坐标
</script>
alert(event.clientX+"==>"+event.clientY);
} //获得鼠标的坐标
</script>
</html>
阅读全文
0 0
- Dom事件02
- DOM事件
- DOM 事件
- DOM 事件
- DOM事件
- dom事件
- dom事件
- DOM事件
- DOM事件
- DOM 事件
- DOM事件
- DOM事件
- DOM事件
- DOM事件
- DOM事件
- DOM事件
- DOM事件
- DOM事件
- SCI收录期刊——采矿和选矿
- Java 编程题目 第五题
- MySQL高级设计之四、索引
- c#中sqlite数据库相关的一些操作总结
- Java概念的通俗理解
- Dom事件02
- 移动端/pc字体两边对齐
- ReactNative 自定义Android原生模块的两种形式
- WebService 入门详解
- 剑指Offer-14
- 四种第三方登录(附源码)
- 通过JitPack方式发布你的库
- SystemBarTint的使用(设置半透明状态栏)
- 【Android实战】----基于Retrofit实现多图片/文件、图文上传