Exercise: Clicking a table entry

Write JavaScript code so that when the table entry with the Z is clicked, the background colour becomes yellow. The CSS class yellow has already been defined for you.

Note:

Hints:

  • Use window.onload.

Solution to the exercise

Here is one possible solution.

Note:

Hints:

  • undefined
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX