Folks, I copied this code from the “Change Text with Click Events” lesson in the JSON section. Although it works on the lesson, when I copy the code to my codepen, it does not work. What is supposed to happen is that the text is supposed to change when I press the button. Yes I activated bootstrap and jQuery in the codepen settings.
html code is:
<div class="container-fluid">
<div class = "row text-center">
<h2>Cat Photo Finder</h2>
</div>
<div class = "row text-center">
<div class = "col-xs-12 well message">
The message will go here
</div>
</div>
<div class = "row text-center">
<div class = "col-xs-12">
<button id = "getMessage" class = "btn btn-primary">
Get Message
</button>
</div>
</div>
</div>
the Javascript code is:
$(document).ready(function() {
$("#getMessage").on("click", function(){
// Only change code below this line.
$(".message").html("Here is the message");
// Only change code above this line.
});
});