Exporting to glitchdotcom/glitch-hello-website
./script.js:31317407/1858
This commit is contained in:
@ -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) {
|
||||||
|
btn.onclick = function() {
|
||||||
// The JS works in conjunction with the 'rotated' code in style.css
|
// The JS works in conjunction with the 'rotated' code in style.css
|
||||||
btn.classList.toggle('rotated');
|
btn.classList.toggle("rotated");
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// This is a single line JS comment
|
// This is a single line JS comment
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user