Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
MinsoftK
2020-04-16 17:45:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3bd7d509f1007989431aba28f0a4cd6eee0d2517
3bd7d509
1 parent
51b088a8
test making and using function
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
41 deletions
front/web/ex/js.html
front/web/ex/js.html
View file @
3bd7d50
...
...
@@ -4,10 +4,38 @@
<title>
KHU KHU Chat
</title>
<meta
charset=
"utf-8"
>
<link
rel=
"stylesheet"
href=
"style.css"
>
<style>
<script>
function
nightDayHandler
(
self
){
var
target
=
document
.
querySelector
(
'body'
);
if
(
this
.
value
===
'night'
)
{
target
.
style
.
backgroundColor
=
'black'
;
target
.
style
.
color
=
'white'
;
this
.
value
=
'day'
;
</style>
var
alist
=
document
.
querySelectorAll
(
'a'
);
var
i
=
0
;
while
(
i
<
alist
.
length
)
{
alist
[
i
].
style
.
color
=
'powderblue'
;
i
+=
1
;
}
}
else
{
target
.
style
.
backgroundColor
=
'white'
;
target
.
style
.
color
=
'black'
;
this
.
value
=
'night'
;
var
alist
=
document
.
querySelectorAll
(
'a'
);
var
i
=
0
;
while
(
i
<
alist
.
length
)
{
alist
[
i
].
style
.
color
=
'blue'
;
i
+=
1
;
}
}
}
</script>
</head>
<body>
...
...
@@ -85,48 +113,12 @@ i+=1;
<!-- button 1 usage array and Loop for chage style -->
<input
id=
"night_day"
type=
"button"
value=
"night"
onclick=
"
var target=document.querySelector('body');
if(document.querySelector('#night_day').value==='night')
{
target.style.backgroundColor= 'black';
target.style.color= 'white';
document.querySelector('#night_day').value= 'day';
var alist=document.querySelectorAll('a');
var i =0;
while(i<alist.length)
{
alist[i].style.color='powderblue';
i+=1;
}
}else{
target.style.backgroundColor= 'white';
target.style.color= 'black';
document.querySelector('#night_day').value= 'night';
var alist=document.querySelectorAll('a');
var i =0;
while(i<alist.length)
{
alist[i].style.color='blue';
i+=1;
}
}
nightDayHandler(this);
"
>
<!-- button2 -->
<!-- button2
making and using function
-->
<input
id=
"night_day"
type=
"button"
value=
"night"
onclick=
"
var target=document.querySelector('body');
if(this.value==='night')
{
target.style.backgroundColor= 'black';
target.style.color= 'white';
this.value= 'day';
}else{
target.style.backgroundColor= 'white';
target.style.color= 'black';
this.value= 'night';
}
nightDayHandler(this);
"
>
<div
id=
"grid"
>
...
...
Please
register
or
login
to post a comment