Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.addEventListener("DOMContentLoaded", () => {
- const buttons = document.querySelectorAll("button");
- for (const button of buttons) {
- button.addEventListener("click", () => {
- document.querySelector("h1").style = `color: ${button.innerText.toLowerCase()}`;
- })
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement