the entire HTML document
the page (document) title
the body element
body
all the elements within the body
document.querySelector("#board")
the (first) element with id="board"
id="board"
document.querySelectorAll("h1")
all the h1 elements
h1
document.querySelectorAll(".player")
all the elements with class="player"
class="player"
document.getElementsByClassName("player").length
document.querySelectorAll(".player").length
the number of elements with class="player"
document.getElementById("p1-name").textContent
the text inside the element with id="p1-name"
id="p1-name"
change the page title
note the double-quotes
document.getElementById("p1-name").textContent = "Sofia"
replace the text of the #p1-name element
#p1-name
document.getElementById("p1-name").append(" & friends")
add to the end of the element's current text
chunks of information we want to work with
that information (data) can be of different types
aka...
\`I ❤️ backticks\`
undefined
null
"supercalifragilisticexpialidocious".length
aka an "index"
"ALOHA".indexOf("L")
"ALOHA".indexOf("A")
"ALOHA".indexOf("Q")
"ALOHA".includes("HA")
"ALOHA".includes("LOL")
"ALOHA".startsWith("AL")
"ALOHA".startsWith("HA")
"ALOHA".indexOf("HA")
"ALOHA".indexOf("LOL")
You should almost always use the strict version
Any guesses what else is out there?
Where can you find them all?
We'll see more kinds of statements later in the course
["lions", "tigers", "bears oh my!"].join(" & ")