Skip to content
Permalink
ac9b814517
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
49 lines (37 sloc) 854 Bytes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Events: Task 1</title>
<style>
p {
color: purple;
margin: 0.5em 0;
}
* {
box-sizing: border-box;
}
button {
display: block;
margin: 20px 0 20px 20px;
}
</style>
<link rel="stylesheet" href="../styles.css" />
</head>
<body>
<section class="preview">
</section>
<button class="off">Machine is off</button>
<script>
const btn = document.querySelector('.off');
// Add your code here
btn.addEventListener('click', function() {
if (btn.innerHTML === 'Machine is off'){
btn.innerHTML = 'Machine is on';
}else{
btn.innerHTML = 'Machine is off';
}
})
</script>
</body>
</html>