JavaScript · Lesson 3 of 4
Show your introduction with a click
hidden controls whether an element is hidden. ! reverses the value: a hidden element appears, then disappears on the next click.
Your task
Run the code, then click twice to show and hide the introduction.
Each new lesson builds on your personal page. Your saved lesson draft opens when you return.
The image stays in your browser. Choose it before running; its filename replaces the example filename.
Edit your project HTML and CSS
Your page
Checks use your current code. Try the page yourself too.
Your feedback
Can you explain what the second click does? Combine these ideas in your project.
Next: Project: interactionI need help
We select the toggle button and details paragraph. If nothing appears, compare those IDs with the HTML under “More explanation”.
Save the page to your computer
If the download does not start, copy the complete code below into a text file named index.html and save it as UTF-8.