Exercise Set 1

Exercise 10 of 15

Make a variable called sayHelloButton. If you're having trouble, rewatch the getting element video.


<button id="sayHelloButton">Say hello</button>
<p id="helloParagraph"></p>


// your code will appear here
var helloParagraph = document.getElementById("helloParagraph");

sayHelloButton.addEventListener("click", sayHello);

function sayHello() {
    helloParagraph.innerHTML = "Hello";

You must be signed in to type your code.

Last exercise Next exercise