请问是哪里出错呢?感觉没错啊。
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<input type="button" value="This is a code" id="one">
<input type="button" value="This is a code" id="two" onClick="a()">
<input type="button" value="This is a code" id="three">
<script type="text/javascript">
var one = document.getElementById("one");
one.onClick=function ()
{
alert('kekeke');
}
function a()
{
alert('hahaha');
}
var three = document.getElementById('three');
three.addEventListener('click',a,false);
var four = document.getElementById("four");
four.attachEvent('onclick',a);
</script>
</body>
</html>