phmg.net
当前位置:首页 >> E.tArgEt 事件委托 >>

E.tArgEt 事件委托

window.onload = function(){ var oUl = document.getElementById("ul"); var aLi = oUl.getElementsByTagName("li"); oUl.onclick = function(ev){ var ev = ev || window.event; var target = ev.target || ev.srcElement; if(target.nodeName...

box.onmousedown = function(event){var e = event || window.event;var target = e.target || e.scrElement;if(target.id == "face" || target.id == "leftEye" || target.id == "rightEye" || target.id == "mouth"){offsetX = e.offsetX;offs...

如下代码可以实现点击页面获得被点击元素的id $(document).click(function(e) { // 在页面任意位置点击而触发此事件 $(e.target).attr("id"); //...

网站首页 | 网站地图
All rights reserved Powered by www.phmg.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com