我的代码有什么问题,为什么点击后不能弹出提示信息
<!DOCTYPE htmL>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div>
<input type="button" value="确定" id="btn1">
</div>
<script type="text/javascript">
function showmes(){
alert('hello world!');
}
var btn1=document.getElementById("btn1");
var eventUtil ={
addHandler:function(element,type,handler){
if(element.addEventListener){
element.addEventListener(type,handler,false);
}
else if(element.attachEvent{
element.attachEvent('on'+type,handler);
}
else {
element['on'+type]=handler;
}
}
}
eventUtil.addHandler(btn1,'click',showmes);
</script>
</body>
</html>