<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Calculator</title>
</head>
<body>
enter first number<input type="text" id="t1"><br>
enter second number<input type="text" id="t2"><br>
<button id="b1" onclick="plu(this)">+</button>
<button id="b2" onclick="min(this)">-</button>
<button id="b3" onclick="pro(this)">*</button>
<button id="b4" onclick="cha(this)">/</button><br>
<input type="text" id="t3" value="0">
</body>
<script>
var t1=document.querySelector('#t1');
var t2=document.querySelector('#t2');
var t3=document.querySelector('#t3');
var b1=document.querySelector('#b1');
var b2=document.querySelector('#b2');
var b3=document.querySelector('#b3');
var b4=document.querySelector('#b4');
b1.onclick=function plu(){
t3.value=+t1.value+ +t2.value
document.getElementById('#t3');
}
b2.onclick=function min(){
t3.value=+t1.value- +t2.value
document.getElementById('#t3');
}
b3.onclick=function pro(){
t3.value=+t1.value* +t2.value
document.getElementById('#t3');
}
b4.onclick=function cha(){
if(t2.value!=0){
t3.value=+t1.value/ +t2.value
document.getElementById('#t3');
}
else{
t3.value='на ноль делить нельзя';
document.getElementById('#t3')
}
}
</script>
</html>