私はウェブサイトを作るのに大きな問題があります。何らかの理由で私は何をしても、私はjavascriptを使うことは決してできません。これを有効にするために欠けているものがありますか?私のサイトでJavascriptが動作しません
たとえば、私は非常に単純なものを正確にコピーしました。 https://codepen.io/thetallweeks/pen/boinE
これはテストファイルで:
<html>
<head>
<script>
$("#button").click(function() {
$('.transform').toggleClass('transform-active');
});
</script>
<style>
.box {
background-color: #218D9B;
height: 100px;
width: 100px;
}
.transform {
-webkit-transition: all 2s ease;
-moz-transition: all 2s ease;
-o-transition: all 2s ease;
-ms-transition: all 2s ease;
transition: all 2s ease;
}
.transform-active {
background-color: #45CEE0;
height: 200px;
width: 200px;
}
</style>
</head>
<body>
<div class="box transform">
</div>
<input type="button" id="button" value="Click Me"></input>
</body>
</html>
しかし、ボタンは私のテストファイルに何もしません。 どうしたのですか?
jqueryがないためです。 –
'$()'はジェネリックJavaScriptではありません.jQueryです。 jQueryライブラリパッケージをインストールしましたか? – Claies