<分区>
我在运行简单的 javascript 代码时遇到问题,我认为代码可能未正确链接。你好心看一下好吗?这是 HTML 代码:
<!DOCTYPE html>
<html>
<head>
<title>Jiggle Into JavaScript</title>
<script type="text/javascript" src="javascript.js"></script>
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> -->
</head>
<body>
<p>Press the buttons to change the box!</p>
<div id="box" style="height:150px; width:150px; background-color:orange; margin:25px"></div>
<button id="Button1">Grow</button>
<button id="Button2">Blue</button>
<button id="Button3">Fade</button>
<button id="Button4">Reset</button>
</body>
</html>
这是 JS 代码:
document.getElementById("Button1").addEventListener("click", function(){
document.getElementById("box").style.height=200%;
});
感谢您提供的任何帮助!