SOURCE

console 命令行工具 X clear

                    
>
console
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple Adder Calculator</title>
<style>
    .calculator {
        margin: 20px;
        padding: 20px;
        border: 1px solid #ccc;
    }
    input, button {
        margin-top: 10px;
    }
</style>
</head>
<body>
<div class="calculator">
    <input type="text" id="num1" placeholder="Enter first number">
    <span>+</span> 
    <input type="text" id="num2" placeholder="Enter second number">
    <span>=</span> 
    <input type="text" id="num3" placeholder="result">
    <button onclick="addNumbers()">计算</button>
   
</div>

<script>
function addNumbers() {
    var num1 = document.getElementById("num1").value;
    var num2 = document.getElementById("num2").value;
    var sum = Number(num1) + Number(num2); // Convert strings to numbers
    document.getElementById("num3").value = sum;
}
</script>
</body>
</html>