-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
41 lines (33 loc) · 1.02 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
var inp1 = document.querySelector(".input1").value;
var inp2 = $(".input2").val();
var minus = inp1-inp2;
var plus = parseInt(inp1)+parseInt(inp2);
var mult = inp1*inp2;
var div = inp1/inp2;
*/
/*$("#result").text();*/
$(".btn2").click(function(){
var inp1 = document.querySelector("#input1").value;
var inp2 = document.querySelector("#input2").value;
var minus = inp1-inp2;
$("#result").text(inp1 + " - " + inp2 + " = " + minus);
});
$(".btn1").click(function(){
var inp1 = $("#input1").val();
var inp2 = $("#input2").val();
var plus = parseInt(inp1)+parseInt(inp2);
$("#result").text(inp1 + " + " + inp2 + " = " + plus);
});
$(".btn3").click(function(){
var inp1 = $("#input1").val();
var inp2 = $("#input2").val();
var mult = inp1*inp2;
$("#result").text(inp1 + " X " + inp2 + " = " + mult);
});
$(".btn4").click(function(){
var inp1 = $("#input1").val();
var inp2 = $("#input2").val();
var div = inp1/inp2;
$("#result").text(inp1 + " / " + inp2 + " = " + div);
});