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:33:32 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
51b088a85d2c87b0339ca47d69f4e4a78d8ee84d
51b088a8
1 parent
fc14fbe3
test change tag style using Loop and array
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
15 deletions
front/web/ex/js.html
front/web/ex/js.html
View file @
51b088a
...
...
@@ -16,21 +16,7 @@
<!--refactoring and conditional statement -->
<input
id=
"night_day"
type=
"button"
value=
"night"
onclick=
"
if(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="
...
...
@@ -74,7 +60,7 @@
<!--Loop & Array
-->
<!--Loop & Array
<script>
var cowokers=["minsung","leezche","minsoft","sdy"];
</script>
...
...
@@ -86,7 +72,62 @@
i+=1;
}
</script>
-->
<!-- Loop apply
var alist=document.querySelectorAll('a');
var i =0;
while(i<alist.length){
console.log(alist[i]);
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;
}
}
"
>
<!-- button2 -->
<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';
}
"
>
<div
id=
"grid"
>
<ol>
...
...
Please
register
or
login
to post a comment