JSFiddle - React, Tailwind, and code Playground

by Nidhi Patel

HTML

<h2>
aithmetic operation for 2 numbers using alert box
</h2><br>
Number1:
<input type = "box" id ="Number1" value=""/><br><br>
Number2:
<input type = "box" id = "Number2" value=""/><br>
<input type="button" value="clickme!!1" id="ni">

JavaScript

//var c = document.getElementById('ni');
//c.addEventListener('click', function(){calculate()}, false);

ni.onclick =function calculate(){

var a = parseInt(document.getElementById("Number1").value);
var b = parseInt(document.getElementById("Number2").value);


alert("Sum is: "+(b+a));
alert("Multiplication is: "+(b*a));
alert("Modulo is:"+(b%a));
}