js file
function gotClick(event,msg,obj){
var object;
var msgs = msg " => clicked Got it!
";
try{
if (event.target) {//Mozilla
object = event.target;
// alert(document.getElementById(object. id).nodeName " Mozilla " msg);
document.getElementById('result').innerHTML =msgs;
// event.cancelBubble=true;//Block delivery
}
else if (event.srcElement){//IE
object = event.srcElement;
// alert(object.id " IE " msg);
// event.cancelBubble=true;//Block delivery
document.getElementById('result').innerHTML =msgs;
}
}catch(e){
alert(e);
}
}
The operation result is:
Button => was clicked!
td => was clicked!
tr => was clicked!
table => was clicked!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn