求前辈指导,主要代码如下:
<button id="btn">按钮</button>
<script type="text/javascript">
function showMessage(){
alert("hello world!");
}
var btn = document.getElementById("btn");
btn.addEventListener('click','showMessage',false);
</script>
btn.addEventListener('click', showMessage, false); showMessage别加引号