daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. document.addEventListener("DOMContentLoaded", () => {
  2.     const buttons = document.querySelectorAll("button");
  3.     for (const button of buttons) {
  4.         button.addEventListener("click", () => {
  5.             document.querySelector("h1").style = `color: ${button.innerText.toLowerCase()}`;
  6.         })
  7.     }
  8. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top