Selmy44 / Simple-Calculator

This is a Simple Calculator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple-Calculator

This is a Simple Calculator

<title>Simple Calculator</title> <style> body { font-family: Arial, sans-serif; text-align: center; margin-top: 100px; } .calculator { display: inline-block; border: 1px solid #ccc; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .calculator input[type="text"] { width: 100%; margin-bottom: 10px; padding: 10px; font-size: 18px; border-radius: 3px; border: 1px solid #ccc; } .calculator button { width: 45px; height: 45px; margin: 5px; font-size: 18px; border-radius: 50%; border: none; cursor: pointer; background-color: #f0f0f0; } .calculator button:hover { background-color: #e0e0e0; } </style>

7 8 9 +
4 5 6 -
1 2 3 *
C 0 = /
<script> function appendToDisplay(value) { document.getElementById('display').value += value; } function clearDisplay() { document.getElementById('display').value = ''; } function calculateResult() { const displayValue = document.getElementById('display').value; let result; try { result = eval(displayValue); } catch (error) { result = 'Error'; } document.getElementById('display').value = result; } </script>

About

This is a Simple Calculator


Languages

Language:HTML 100.0%