私のシンプルなJavaScriptコードを実行するのに問題があります。コードが正しくリンクされていない可能性があります。あなたは親切に見えるでしょうか?ここではHTMLのコードは次のとおりです。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%;
});
ありがとう!
** idを持つ要素 'Button1':あなたはこれを試してみてください –