Skip to content

Commit

Permalink
button works
Browse files Browse the repository at this point in the history
  • Loading branch information
kmr18006 committed Mar 21, 2024
1 parent 3a86306 commit 6ebdb49
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions week-09/event1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@
<button class="off">Machine is off</button>

<script>
const btn = document.querySelector('.off');
let btn = document.querySelector('button')

// Add your code here
btn.addEventListener('click', function() {
if (btn.innerText === "Machine is off") {
btn.innerText = "Machine is on";
} else {
btn.innerText = "Machine is off";
}
})

</script>

Expand Down

0 comments on commit 6ebdb49

Please sign in to comment.