guys, I have problems with a basic calculator js object only to add numbers input1 + input2 = input3. I have no clue how to display the result for input 1 and 2 in input 3 ( result ). From now I just get value from inputs using show('1'). This is my code
JS
function calculator(){
this.result = document.getElementById('3');
this.show = function(id){
var a =document.getElementById(id).value
console.log(a);
}
}
HTML
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<label for="1">
<input type="text" id = '1'>
</label>
<br><br>
<label for="2">
<input type="text" id = '2'>
</label>
<br><br>
<label for="3">
<input type="text" id = 3>
</label>
<button onclick="click()">+</button>
<script src="jss.js"></script>
</body>
</html>