+ 1
Need help to solve this problem.....
What is the error of it?? I can't understand... I want to multiply two number which is in box when click on click button..... Plz help me.... https://code.sololearn.com/WuGV88suHfE2/?ref=app
2 Answers
+ 7
Replace your HTML by :
<!DOCTYPE html>
<html>
<head>
<title>Multiplication</title>
</head>
<body>
<h1>Multiplication</h1>
<input type="number" id="mul1" placeholder="Enter a number">
<input type="number" id="mul2" placeholder="Enter a number">
<button onclick="show()">click me</button>
<div id = "res"></div>
</body>
</html>
and JavaScript by :
function show(){
var a = document.getElementById("mul1").value;
var b = document.getElementById("mul2").value;
document.getElementById("res").innerHTML = a*b;
}
+ 2
Thnks @atikrant negi.....