Basic Start and Stop
Lesson 8 of 10 in Coddy's Stopwatch - HTML/CSS/JS Project course.
Let's move to the JS part, it might be a bit harder, but we will do it step by step!
Challenge
EasyIn the JS file:
- Add a click event listener to the start/stop button
- Once clicked, change the button text to
Stop - Once clicked again, change the button text back to
Startand so on…
You will need to keep an outside variable that will be toggled each time.
Check hints if stuck!
Try it yourself
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Write HTML code here -->
<script src="script.js"></script>
</body>
</html>