<input id="button" type="button" value="按钮">
<script>
document.onclick = function(){
var obj = event.srcElement;
if (obj.type == "button"){
alert(obj,id)
}
}
</script>
<input id="button" type="button" value="按钮">
<script>
document.onclick = function(){
var obj = event.srcElement;
if (obj.type == "button"){
alert(obj,id)
}
}
</script>