-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
37 lines (33 loc) · 1015 Bytes
/
app.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
var num1 = document.getElementById('num1')
var num2 = document.getElementById('num2')
var result = document.getElementById('result')
function calculator(sign){
var num1Value = num1.value
var num2Value = num2.value
if(sign == '+')
{
result.innerText = parseInt(num1Value) + parseInt(num2Value)
}
if(sign == '-')
{
result.innerText = parseInt(num1Value) - parseInt(num2Value)
}
if(sign == '*')
{
result.innerText = parseInt(num1Value) * parseInt(num2Value)
}
if(sign == '/')
{
result.innerText = parseInt(num1Value) / parseInt(num2Value)
}
}
var hours = document.getElementById("hours")
var minutes = document.getElementById("minutes")
var seconds= document.getElementById("seconds")
var updated = setInterval(function(){
var date =new Date()
hours.innerText = date.getHours()
minutes.innerText = date.getMinutes()
seconds.innerText = date.getSeconds()
},1000
)