Skip to main content
100%

onclick changing background color

✓ Published0🌍 Public
NNita
Last edited May 31, 2022
Created on May 31, 2022
Forked from HTML Starter

This example demonstrates how clicking anywhere on an HTML page changes the background color to yellow, while a specific button turns blue upon page load. The page contains a simple message, a styled button, and uses vanilla JavaScript with inline `onclick` event handling and `document.getElementById` to manipulate the DOM. It relies on the Window object's `onclick` property and element style properties (`style.backgroundColor`) rather than any external libraries or frameworks, though it references a React starter as an alternative approach.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes