Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (40 sloc) 871 Bytes
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8"/>
<title>Events: Task 1</title>
p {
color: purple;
margin: 0.5em 0;
* {
box-sizing: border-box;
button {
display: block;
margin: 20px 0 20px 20px;
<link rel="stylesheet" href="../styles.css" />
<section class="preview">
<button class="off">Machine is off</button>
let btn = document.querySelector('.off');
btn.addEventListener('click', updateButton)
let off = true;
function updateButton() {
if (off) {
btn.innerHTML = 'Machine is on';
off = false;
} else {
btn.innerHTML = 'Machine is off'
off = true;
You can’t perform that action at this time.