Menu
Coddy logo textTech

function deleteLast

Lesson 13 of 14 in Coddy's DOM Project - Calculator course.

challenge icon

Challenge

Easy
  1. Write a function deleteLast() that removes the last value from the id ‘display’ each time you click on the ‘←’ button.
  2. Set the attribute onclick to “deleteLast()” for the button with the text ‘←’.

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