我用sublime text 编的,可以帮我看下那里错了吗,按钮2不开

<!doctype html>

<html>

<head>

<meta charset="UTF-8">

<title>Document</title>

</head>

<body>

<input type="button" value="按钮" id="btn" onclick="showmassage()">


<input type="button" value="按钮2" id="btn2">



<script type="text/javascript">

function showmassage () {

alert('hello world!')

}



  var btn2=Document.getElementById('btn2')

btn2.onclick=function(){alert("jjj")}



</script>

</body>

</html>


幕布斯6906120
浏览 1249回答 1
1回答

十二维生物

  var btn2=Document.getElementById('btn2') //Document 变成猪小写的document
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript