Exporting to glitchdotcom/glitch-hello-website

./script.js:31317407/1858
This commit is contained in:
Glitch (glitch-hello-website)
2021-05-27 14:34:27 +00:00
parent 8fb1d937b5
commit ae651900b2

View File

@ -13,10 +13,12 @@ Make the "Click me!" button rotate when the visitor clicks it:
*/ */
const btn = document.querySelector("button"); // Get the button from the page const btn = document.querySelector("button"); // Get the button from the page
// Detect clicks on the button // Detect clicks on the button
btn.onclick = function() { if (btn) {
// The JS works in conjunction with the 'rotated' code in style.css btn.onclick = function() {
btn.classList.toggle('rotated'); // The JS works in conjunction with the 'rotated' code in style.css
}; btn.classList.toggle("rotated");
};
}
// This is a single line JS comment // This is a single line JS comment
/* /*