I'm doing some initial testing with javascript, and I'm not succeeding when trying to change a parameter from my HTML code. The idea is that by clicking the "Message" button, the text will be updated to "New Text!" Here is the HTML and javascript code:
<html>
<h1>Javascript</h1>
<h3 id="frase">Default text</h3>
<button id = "getMessage" class = "btn btn-primary"> Message </button>
</html>
$(document).ready(function() {
$("#getMessage").on("click", function(){
document.getElementById("frase").innerHTML = "New text!";
});
});
How do I integrate what is displayed in HTML with my javascript code?