JavaScriptHTML + CSS + JavaScript
Draft saved locallyJavaScript · Spaces: 2
Live preview move your pointer inside
Make the Button Run Code
An event is something that happens in the page. A click is one event.
button.addEventListener("click", doSomething);The function name is passed without () because the browser should call it later, when the click happens.
Learn more
01
Your mission
Make the POWER UP button change the message when clicked.
- Select
#power-buttonintoconst powerButton. - Select
#power-textintoconst powerText. - Create a function named
showPowerthat changes the text toPower button clicked!. - Attach
showPowerto the button'sclickevent withaddEventListener.
Check my work Run project