onclick changing background color
✓ Published0🌍 Public
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 descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed