MinsoftK

test for using tag

......@@ -14,6 +14,11 @@ function LinksSetColor(color){
i+=1;
}
}
var Body={
setColor:function(color){
}
}
function bodySetColor(color){
document.querySelector('body').style.color= color;
}
......
var Links={
SetColor:function(color){
var alist=document.querySelectorAll('a');
var i =0;
while(i<alist.length)
{
alist[i].style.color=color;
i+=1;
}
}
}
var Body = {
SetColor:function(color){
document.querySelector('body').style.color= color;
},
SetBackGruondColor:function(color){
document.querySelector('body').style.backgroundColor= color;
}
}
function nightDayHandler(self){
if(self.value==='night')
{
Body.SetBackGruondColor('black')
Body.SetColor('white');
self.value= 'day';
Links.SetColor('white');
}else{
Body.SetBackGruondColor('white')
Body.SetColor('black');
self.value= 'night';
Links.SetColor('blue');
}
}
......@@ -20,11 +20,15 @@
</script>
<h2>iterate</h2>
<h2>property & method</h2>
<script>
for(var key in coworkers){
document.write(key+' : ' +coworkers[key]+'<br>');
coworker.showAll =function(){
for(var key in this){
document.write(key+' : ' +this[key]+'<br>');
}
}
coworkers.showAll();
</script>
</body>
</html>
......
......@@ -4,53 +4,12 @@
<title>KHU KHU Chat</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script>
var Links={
SetColor:function(color){
var alist=document.querySelectorAll('a');
var i =0;
while(i<alist.length)
{
alist[i].style.color=color;
i+=1;
}
}
}
var Body = {
SetColor:function(color){
document.querySelector('body').style.color= color;
},
SetBackGruondColor:function(color){
document.querySelector('body').style.backgroundColor= color;
}
}
function nightDayHandler(self){
if(self.value==='night')
{
Body.SetBackGruondColor('black')
Body.SetColor('white');
self.value= 'day';
Links.SetColor('powderblue');
}else{
Body.SetBackGruondColor('white')
Body.SetColor('black');
self.value= 'night';
Links.SetColor('blue');
}
}
</script>
<script src="colors.js"></script>
</head>
<body>
<input id="night_day" type="button" value="night" onclick="
nightDayHandler(this);
">
<!-- button2 making and using function -->
<input id="night_day" type="button" value="night" onclick="
nightDayHandler(this);
......