<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
<script>
$(document).ready(function() {
$('#getQuote').on("click", functon() {
$('.message').html("Here is the message");
});
});
</script>
<body>
<div class="container-fluid">
<div class="row text-center">
<h1>Random Quote Machine</h1>
</div>
<div class="row text-center">
<div class="well message">
The quote will go here
</div>
</div>
<div class="row text-center">
<button id="getQuote" class="btn btn-primary">Get Quote </button>
</div>
</div>
</body>
こんにちは私はプログラミングには新しいので、これを行うにはcodepen.ioを使用しています。私はなぜボタンをクリックして "メッセージを取得する" divのメッセージが新しいメッセージに変更されないのだろうかと思っていた。ところで、私はfreecodecampを使ってコードを書くことを学んでいます。このコードはfreecodecampのウェブサイトではなく、codepenで動作しました。私は何が間違っているのだろうと思っています。 codepenで、私が得るエラーは "Unexpected Token {"です。どんな助けでも大歓迎です。ボタンをクリックしたときにdiv内のテキストを変更する方法はありますか?