3.06 · Lab
Selecting DOM Elements
The first time your script reaches out of itself and takes hold of something real on a page. Grab tight — next lesson gives you things to do with it.
Exercise
Grab hold of two wires
Checks itself — try as often as you likeUsing the elements already on the page:
- Select the heading (
#status) into a variable calledstatusHeading. - Select the button (
#power-button) into a variable calledpowerButton.