Step 6: Go to script.js, and add the following:
let myButton = document.getElementById(`myButton`)
The keyword
let
creates a variable, which is something
that can store a value. All variables have names, and in this case,
the name is myButton. Variable names should be camel cased. The
operator
=
assigns a value to a variable. The value can
be a number, a string which is a sequence of characters, or an object
which is a collection of numbers, strings, and other objects. In this
case, the value is the result of
document.getElementById(`myButton`)
, which finds an
element on the page with
id
myButton, and returns it as
a button object.