• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
邹天得
博客园    首页    新随笔    联系   管理    订阅  订阅

target、srcElement和window.event

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
<script type="text/javascript">
  function onClickMe(oEvent){
  console.log("window.event.type is " + window.event.type);
  console.log("arguments.callee.caller.arguments[0] is " + arguments.callee.caller.arguments[0].type); //或者arguments[0].type
  console.log("oEvent.target is " + oEvent.target.style.width);
  console.log("oEvent.target is " + oEvent.target.tagName);
  console.log("oEvent.srcElement is " + oEvent.srcElement.innerHTML);
}
</script>
</head>
<body>
<div style="background:red;width:100px;height:30px;" onclick="onClickMe(event);">Click Me!</div>
</body>
</html>

 

 

posted on 2017-07-14 19:31  邹天得  阅读(100)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3