Showing
1 changed file
with
65 additions
and
6 deletions
... | @@ -14,20 +14,79 @@ | ... | @@ -14,20 +14,79 @@ |
14 | <h1><a href="main.html" color:black>KHU Chatting service</a></h1> | 14 | <h1><a href="main.html" color:black>KHU Chatting service</a></h1> |
15 | <img src="image/signin.jpg" class="image"> | 15 | <img src="image/signin.jpg" class="image"> |
16 | 16 | ||
17 | +<!--refactoring and conditional statement --> | ||
18 | + | ||
17 | <input id="night_day" type="button" value="night" onclick=" | 19 | <input id="night_day" type="button" value="night" onclick=" |
18 | - if(document.querySelector('body').style.backgroundColor==='black') | 20 | + if(document.querySelector('#night_day').value==='night') |
19 | { | 21 | { |
20 | - document.querySelector('body').style.backgroundColor= 'white'; | 22 | + |
21 | - document.querySelector('body').style.color= 'black'; | 23 | + var target=document.querySelector('body'); |
22 | - document.querySelector('#night_day').value= 'night'; | 24 | + |
25 | + target.style.backgroundColor= 'black'; | ||
26 | + target.style.color= 'white'; | ||
27 | + document.querySelector('#night_day').value= 'day'; | ||
23 | }else{ | 28 | }else{ |
29 | + target.style.backgroundColor= 'white'; | ||
30 | + target.style.color= 'black'; | ||
31 | + document.querySelector('#night_day').value= 'night'; | ||
32 | + } | ||
33 | + "> | ||
34 | +<!-- about this grammer | ||
35 | + | ||
36 | + <input type="button" value="night" onclick=" | ||
37 | + if(this.value==='night') | ||
38 | + { | ||
24 | document.querySelector('body').style.backgroundColor= 'black'; | 39 | document.querySelector('body').style.backgroundColor= 'black'; |
25 | document.querySelector('body').style.color= 'white'; | 40 | document.querySelector('body').style.color= 'white'; |
26 | - document.querySelector('#night_day').value= 'day'; | 41 | + this.value= 'day'; |
42 | + }else{ | ||
43 | + document.querySelector('body').style.backgroundColor= 'white'; | ||
44 | + document.querySelector('body').style.color= 'black'; | ||
45 | + this.value= 'night'; | ||
27 | } | 46 | } |
47 | + "> | ||
48 | + --> | ||
28 | 49 | ||
29 | 50 | ||
30 | - "> | 51 | + |
52 | +<!-- about array | ||
53 | + <script> | ||
54 | + var cowokers=["minsing","minsoft"]; | ||
55 | + document.write(cowokers[0]); | ||
56 | + document.write(cowokers[1]); | ||
57 | + cowokers.push("ssssss") | ||
58 | + document.write(cowokers); | ||
59 | + </script> | ||
60 | +--> | ||
61 | + | ||
62 | +<!-- about Loop | ||
63 | +<ul> | ||
64 | + <script> | ||
65 | + var i=0; | ||
66 | + while(i<3) | ||
67 | + { | ||
68 | + document.write("<li>var</li>") | ||
69 | + i+=1; | ||
70 | + } | ||
71 | + </script> | ||
72 | +</ul> | ||
73 | +--> | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | +<!--Loop & Array --> | ||
78 | +<script> | ||
79 | + var cowokers=["minsung","leezche","minsoft","sdy"]; | ||
80 | +</script> | ||
81 | + | ||
82 | +<script> | ||
83 | + var i=0; | ||
84 | + while( i< cowokers.length ){ | ||
85 | + document.write('<li><a href="http://a.com/'+cowokers[i]+'">'+cowokers[i]+'</a></li>'); | ||
86 | + i+=1; | ||
87 | + } | ||
88 | +</script> | ||
89 | + | ||
31 | 90 | ||
32 | <div id="grid"> | 91 | <div id="grid"> |
33 | <ol> | 92 | <ol> | ... | ... |
-
Please register or login to post a comment