MinsoftK

save tag about array

......@@ -14,20 +14,79 @@
<h1><a href="main.html" color:black>KHU Chatting service</a></h1>
<img src="image/signin.jpg" class="image">
<!--refactoring and conditional statement -->
<input id="night_day" type="button" value="night" onclick="
if(document.querySelector('body').style.backgroundColor==='black')
if(document.querySelector('#night_day').value==='night')
{
document.querySelector('body').style.backgroundColor= 'white';
document.querySelector('body').style.color= 'black';
document.querySelector('#night_day').value= 'night';
var target=document.querySelector('body');
target.style.backgroundColor= 'black';
target.style.color= 'white';
document.querySelector('#night_day').value= 'day';
}else{
target.style.backgroundColor= 'white';
target.style.color= 'black';
document.querySelector('#night_day').value= 'night';
}
">
<!-- about this grammer
<input type="button" value="night" onclick="
if(this.value==='night')
{
document.querySelector('body').style.backgroundColor= 'black';
document.querySelector('body').style.color= 'white';
document.querySelector('#night_day').value= 'day';
this.value= 'day';
}else{
document.querySelector('body').style.backgroundColor= 'white';
document.querySelector('body').style.color= 'black';
this.value= 'night';
}
">
-->
<!-- about array
<script>
var cowokers=["minsing","minsoft"];
document.write(cowokers[0]);
document.write(cowokers[1]);
cowokers.push("ssssss")
document.write(cowokers);
</script>
-->
<!-- about Loop
<ul>
<script>
var i=0;
while(i<3)
{
document.write("<li>var</li>")
i+=1;
}
</script>
</ul>
-->
<!--Loop & Array -->
<script>
var cowokers=["minsung","leezche","minsoft","sdy"];
</script>
<script>
var i=0;
while( i< cowokers.length ){
document.write('<li><a href="http://a.com/'+cowokers[i]+'">'+cowokers[i]+'</a></li>');
i+=1;
}
</script>
<div id="grid">
<ol>
......