E-Learning Platform
0 of 139 builtAlways freeSign in
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 like

Using the elements already on the page:

  • Select the heading (#status) into a variable called statusHeading.
  • Select the button (#power-button) into a variable called powerButton.