Hallo, ich habe folgenden code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculator</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Fascinate&family=Poppins:ital,wght@1,200&family=Red+Hat+Mono:wght@300&family=Roboto&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<link rel="manifest" href="manifest.webmanifest">
<style>
</style>
<script>
function appendOperation(operation){
document.getElementById("resultArea").innerHTML += operation;
}
function calculateResult() {
let container = document.getElementById("resultArea");
let result = eval(container.innerHTML);
container.innerHTML = result;
}
function deleteLast() {
let container = document.getElementById("resultArea");
if (container.innerHTML.endsWith(' ')) {
container.innerHTML = container.innerHTML.slice(0, -3);
} else {
container.innerHTML = container.innerHTML.slice(0, -1);
}
}
</script>
</head>
<body>
<div id="resultArea">
</div>
<table>
<tr>
<td></td>
<td></td>
<td></td>
<td onclick="deleteLast()">DEL</td>
</tr>
<tr>
<td onclick="appendOperation(7)">7</td>
<td onclick="appendOperation(8)">8</td>
<td onclick="appendOperation(9)">9</td>
<td onclick="appendOperation(' / ')" class="highlight">/</td>
</tr>
<tr>
<td onclick="appendOperation(6)">6</td>
<td onclick="appendOperation(5)">5</td>
<td onclick="appendOperation(4)">4</td>
<td onclick="appendOperation(' * ')" class="highlight">*</td>
</tr>
<tr>
<td onclick="appendOperation(1)">1</td>
<td onclick="appendOperation(2)">2</td>
<td onclick="appendOperation(3)">3</td>
<td onclick="appendOperation(' + ')" class="highlight">+</td>
</tr>
<tr>
<td onclick="appendOperation(0)">0</td>
<td onclick="appendOperation('.')">.</td>
<td onclick="calculateResult()" id="result">=</td>
<td onclick="appendOperation(' - ')" class="highlight">-</td>
</tr>
</table>
</body>
</html>
ICH KANN AUF DEM PC DAS = DRÜCKEN UND DEL DRÜCKEN, ALSO ZUM LÖSCHEN:
ABER AUF DEM HANDY KANN ICH NICHT = UND DEL DRÜCKEN, WORAN KANN DAS LIEGEN?
ICH NUTZE ANDROID MIT CHROME:
LG