<!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");
btn1.addEventListener('click', showmes,false);
</script>
</body>
</html>
表示接收的是一个事件类型type,必须要加的