87,910
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type="text/javascript">
function onLoad(){
document.getElementById("t1").onclick=function(){alert(this.value);}
document.getElementById("t2").onclick=function(){alert(this.value);}
}
</script>
</head>
<body onload="onLoad()">
<div id="myDiv">
<input type="text" id="t1" value="v1" />
<input type="text" id="t2" value="v2" />
</div>
</body>
</html>
<html>
<head>
<title>test</title>
<script>
window.onload=function(){
document.body.onclick=function(){
alert(document.elementFromPoint(event.x,event.y).type);
}
}
</script>
</head>
<body >
<form>
<input type="button" value="click">
<input type="radio" name="" value="">
<input type="text" >
<input type="password" >
<input type="checkbox" name="" value="">
</form>
</body>
</html>