Toggle navigation
Toggle navigation
This project
Loading...
Sign in
임호준
/
WebPractice
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
임호준
2017-04-25 11:53:54 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b5ddc0d83adca471dded12a61c9750b22a5f61e3
b5ddc0d8
1 parent
46c4f9f8
0425 자바스크립트 실습
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
0 deletions
자바스크립트/practice10(inputText로 입력받아 생년월일출력).html
자바스크립트/practice11(학점입력받아 출력).html
자바스크립트/practice9.js
자바스크립트/practice10(inputText로 입력받아 생년월일출력).html
0 → 100644
View file @
b5ddc0d
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<title>
practice10
</title>
</head>
<body>
<input
type=
"text"
name=
""
value=
""
id=
"input1"
>
<input
type=
"button"
name=
""
value=
"입력"
onclick=
"call()"
>
<div
id =
"div1"
>
</div>
<script
type=
"text/javascript"
>
function
call
(){
// var birth = prompt("생년월일을 입력해주세요","6자리 입력");
var
birth
=
document
.
getElementById
(
"input1"
).
value
;
if
(
birth
!=
""
){
var
temp
=
document
.
getElementById
(
"div1"
);
var
a
=
birth
.
substr
(
0
,
2
);
var
b
=
birth
.
substr
(
2
,
2
);
var
c
=
birth
.
substr
(
4
,
2
);
//temp.innerHTML = birth.length;
temp
.
innerHTML
=
"생일:19"
+
a
+
"년 "
+
b
+
"월 "
+
c
+
"일"
;
}
}
</script>
</body>
</html>
자바스크립트/practice11(학점입력받아 출력).html
0 → 100644
View file @
b5ddc0d
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<title>
practice10
</title>
</head>
<body>
학점:
<input
type=
"text"
name=
""
value=
""
id=
"input1"
>
<input
type=
"button"
name=
""
value=
"입력"
onclick=
"call()"
>
<div
id =
"div1"
>
</div>
<script
type=
"text/javascript"
>
function
call
(){
var
score
=
document
.
getElementById
(
"input1"
).
value
;
if
(
score
!=
""
){
var
temp
=
document
.
getElementById
(
"div1"
);
if
(
score
>=
90
){
temp
.
innerHTML
=
"<h1>your grade is A</h1> "
;
}
else
if
(
score
>=
80
&&
score
<=
89
){
temp
.
innerHTML
=
"<h1>your grade is B</h1> "
;
}
else
if
(
score
>=
70
&&
score
<=
79
){
temp
.
innerHTML
=
"<h1>your grade is C</h1> "
;
}
else
{
temp
.
innerHTML
=
"<h1>your grade is F</h1> "
;
}
}
}
</script>
</body>
</html>
자바스크립트/practice9.js
0 → 100644
View file @
b5ddc0d
var
sum
=
0
;
for
(
var
i
=
1
;
i
<=
5
;
i
++
){
sum
+=
i
;
}
console
.
log
(
sum
/
5
);
var
a
=
"1"
;
var
b
=
2
;
console
.
log
(
a
+
b
);
var
_a
=
1
;
var
_b
=
2
;
console
.
log
(
_a
+
_b
);
console
.
log
(
parseFloat
(
"23FF2"
))
Please
register
or
login
to post a comment