+ 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

8th Dec 2017, 4:20 PM
Lalit Patil
Lalit Patil - avatar
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; }
8th Dec 2017, 4:28 PM
RZK 022
RZK 022 - avatar
+ 2
Thnks @atikrant negi.....
8th Dec 2017, 5:07 PM
Lalit Patil
Lalit Patil - avatar