-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEchange.js
33 lines (22 loc) · 812 Bytes
/
Echange.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
let usd = document.getElementById('usd');
let mad =document.getElementById('mad');
function Echange(coff ="10.66"){
document.body.style.textAlign="center";
let dv = document.getElementsByTagName('div')[0];
// this.document.body.style.backgroundImage="url(DtoD.jpg)";
// this.document.body.style.background = "linear-gradient(35deg, red, #FFCCCC);"
// this.document.body.style.backgroundRepeat="no-repeat";
// this.document.body.style.backgroundSize="100%";
usd.style.height="30px"
mad.style.height="30px"
dv.style.setProperty('margin','200px');
usd.onkeyup= function(){
mad.value = usd.value * coff;
usd.style.backgroundColor="#eee";
}
mad.onkeyup= function(){
usd.value= mad.value/coff;
mad.style.backgroundColor="#eee"
}
}
Echange();