I'm trying to build a calculator using JavaScript.I tried to display the value '0' in the screen,but it doesn't working.Can i know why is that ?
My js file
const calculator = {
displayValue: '0';firstOperand: null;waitingForSecondOperand: false;operator: null;
}
function updateDisplay() {
const display = document.querySelector('.calculator-dipalay');
display.value = calculator.displayValue;
}
updateDisplay();
my HTML code
</html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
<script src="myscript.js"></script>
</head>
<body>
<div class="calculator">
<input type="text" class="calculator-dipalay" value="" disabled/>
</div>
</body>
</html>