Calculator
Calculator
```html
<!DOCTYPE html>
<html>
<head>
<title>HTML Calculator</title>
<style>
.calculator {
width: 200px;
padding: 10px;
</style>
</head>
<body>
<div class="calculator">
<br>
<button onclick="appendToResult('1')">1</button>
<button onclick="appendToResult('2')">2</button>
<button onclick="appendToResult('3')">3</button>
<button onclick="appendToResult('+')">+</button>
<br>
<button onclick="appendToResult('4')">4</button>
<button onclick="appendToResult('5')">5</button>
<button onclick="appendToResult('6')">6</button>
<button onclick="appendToResult('-')">-</button>
<br>
<button onclick="appendToResult('7')">7</button>
<button onclick="appendToResult('8')">8</button>
<button onclick="appendToResult('9')">9</button>
<button onclick="appendToResult('*')">*</button>
<br>
<button onclick="appendToResult('0')">0</button>
<button onclick="appendToResult('.')">.</button>
<button onclick="calculateResult()">=</button>
<button onclick="appendToResult('/')">/</button>
<br>
<button onclick="clearResult()">Clear</button>
</div>
<script>
function appendToResult(value) {
document.getElementById("result").value += value;
function calculateResult() {
document.getElementById("result").value = result;
}
function clearResult() {
document.getElementById("result").value = "";
</script>
</body>
</html>
```
This example creates a basic calculator interface with buttons for numbers, arithmetic operations, and a
text input field to display the result. JavaScript functions are used to handle button clicks, append values
to the result, perform calculations, and clear the result. Note that the `eval()` function is used to
evaluate the mathematical expression entered in the input field and calculate