Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 1
I have problem with my project on sololearn
I made calculator and input that shows the numbers calls itself that it has null value and I don't know why
3 Answers
+ 1
Brother please post your code also. It will get easy to find mistake and correct it.
+ 1
var number_box = document.getElementById("number_box");
var buttons = document.getElementsByClassName("buttons");
var memory = '';
function plus() {
number_box.value += "+";
}
function one() {
number_box.value += 1;
}
0
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
</head>
<body>
<div id = "container">
<input type="number" id="number_box" disabled placeholder="1" name = "number_box"/>
<br />
<div id = "buttons-container">
<button class = "buttons" id = "parentheses" onclick="parentheses()">( )</button>
<button class = "buttons" id = "power" onclick="power()">x<sup>2</sup></button>
<button class = "buttons" id = "sqrt">sqrt</button>
<button class = "buttons" id = "divide">/</button>
<br />
<button class = "buttons" id = "seven">7</button>
<button class = "buttons" id = "eight">8</button>
<button class = "buttons" id = "nine">9</button>
<button class = "buttons" id = "modulo">%</button>
<br />
<button class = "buttons" id = "four">4</button>
<button class = "buttons" id = "