Electronic Scientific Calculator

Electronic Scientific Calculator

Calculate scientific functions with this electronic scientific calculator.

function appendToDisplay(value) { document.getElementById(‘display’).value += value; } function calculateResult() { try { let result = eval(document.getElementById(‘display’).value); document.getElementById(‘display’).value = result; } catch (e) { document.getElementById(‘display’).value = ‘Error’; } } function clearDisplay() { document.getElementById(‘display’).value = ”; } .calculator-container { width: 300px; margin: 50px auto; padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); background-color: #f9f9f9; font-family: Arial, sans-serif; } .calculator-header { text-align: center; margin-bottom: 20px; } .calculator-display { width: 100%; padding: 10px; font-size: 24px; text-align: right; margin-bottom: 20px; border-radius: 5px; border: 1px solid #ccc; } .calculator-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; } .calc-btn { padding: 15px; font-size: 18px; background-color: #0093da; color: white; border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.3s; } .calc-btn:hover { background-color: #007bb5; }

Leave a Reply

Your email address will not be published. Required fields are marked *