function clearDisplay
Lesson 12 of 14 in Coddy's DOM Project - Calculator course.
Challenge
Easy- Write a function clearDisplay() that clears all the text written in 'display'.
- For a button with the text ‘C’ set an attribute onclick with the function clearDisplay() so that it can work after each time we click on the button.
- Test it: Refresh the web, and after clicking on numbers, click on the button 'C' to see if it works!
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>All lessons in DOM Project - Calculator
1Introduction
What will you build?4Make it work
function appendToDisplay