-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject12.js
More file actions
42 lines (25 loc) · 840 Bytes
/
Copy pathproject12.js
File metadata and controls
42 lines (25 loc) · 840 Bytes
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
42
// document.body.innerHTML+='<h1>amor</h1>';
document.title='amor';
// document.querySelector('#amor').innerHTML ='mousa' ;
// console.log(document.querySelector('#amor')) ;
// console.log(document.querySelector('.amor')) ;
subscribbtn = function() {
let subscribbtn = document.querySelector('#subscrib-btn') ;
if(subscribbtn.innerHTML=='subscribe'){
subscribbtn.innerHTML='subscriped';
}
else{
subscribbtn.innerHTML='subscribe';
}
}
function calculat() {
let costInput = document.querySelector('#cost');
let res = document.querySelector('#res');
let cost = Number(costInput.value);
if (cost >= 40) {
res.innerHTML = `Shipping is FREE. Total = $${cost}`;
} else {
res.innerHTML = `Shipping is $10. Total = $${cost + 10}`;
}
}
// subscribbtn()