Test
<!DOCTYPE html> <html> <head> <title>Calculator</title> <style> #calculator { width: 200px; padding: 10px; border: 1px solid #ccc; box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2); } input[type="text"] { width: 100%; margin-bottom: 10px; padding: 5px; } input[type="button"] { width: 48%; padding: 5px; margin: 1%; } </style> <script> function calculate() { var num1 = parseFloat(document.getElementById('num1').value); var num2 = parseFloat(document.getElementById('num2').value); var operator = document.getElementById('operator').value; var result; if (operator === '+') { result = num1 + num2; } else if (operator === '