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-13 12:03:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
46c4f9f854e250d4362713ade075e45f289537d6
46c4f9f8
1 parent
312326cb
0413자바스크립트 실습
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
0 deletions
자바스크립트/hello.js
자바스크립트/jsprac01.html
자바스크립트/버튼(새창만들기,사진띄우기,location.assign)연습.html
자바스크립트/사용자입력받기.html
자바스크립트/hello.js
0 → 100644
View file @
46c4f9f
function
message
(){
document
.
write
(
"????"
);
var
d
=
new
Date
(
300000000
);
document
.
getElementById
(
"demo"
).
innerHTML
=
d
;
}
자바스크립트/jsprac01.html
0 → 100644
View file @
46c4f9f
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<title>
js
</title>
<script
type=
"text/javascript"
src =
"hello.js"
></script>
</head>
<body
onload=
"message()"
>
<script
type=
"text/javascript"
>
</script>
<p>
hi
<hr></p>
<p
id=
"demo"
>
</p>
</body>
</html>
자바스크립트/버튼(새창만들기,사진띄우기,location.assign)연습.html
0 → 100644
View file @
46c4f9f
<!DOCTYPE html>
<html
lang=
"ko"
>
<meta
charset=
"utf-8"
>
<body>
<button
onclick=
"myFunction()"
>
Try it
</button>
<button
onclick=
"myFunction2()"
>
try it
</button>
<button
onclick=
"myFunction3()"
>
사진 띄우기
</button>
<button
onclick=
"myFunction4()"
>
네이버로가기
</button>
<div
id=
"id"
>
안녕하십니까
</div>
<div
id=
"id2"
>
안녕하세영
</div>
<script>
function
myFunction
()
{
var
mywindow
=
window
.
open
(
""
,
"_self"
,
"width=500,height = 300"
);
mywindow
.
document
.
write
(
"<h1>Hello</h1>"
);
}
function
myFunction2
()
{
var
x
=
document
.
getElementById
(
"id"
);
x
.
innerHTML
=
"changed"
;
}
function
myFunction3
()
{
var
x
=
document
.
getElementById
(
"id2"
);
x
.
innerHTML
=
"<img src=../punch.gif>"
;
//src 뒤에 "" 가 오면 이 코드는 ""<img src = .."까지 밖에 인식하지못해 error발생함
}
function
myFunction4
(){
location
.
assign
(
"http://www.naver.com"
);
}
</script>
</body>
</html>
자바스크립트/사용자입력받기.html
0 → 100644
View file @
46c4f9f
<!DOCTYPE html>
<html
lang=
"ko"
>
<head>
<meta
charset=
"utf-8"
>
<title>
123
</title>
</head>
<body>
<button
type=
"button"
onclick =
"myFunction()"
name=
"button"
>
click this
</button>
<div
id=
"div1"
>
<h1>
안녕하세요
</h1>
</div>
<input
type=
"text"
name=
""
value=
""
id=
"input1"
>
<button
type=
"button"
onclick=
"myFunction2()"
name=
"button"
>
click this
</button>
<div
id=
"div2"
>
</div>
<script
type=
"text/javascript"
>
"use strict"
;
function
myFunction
(){
var
name
=
prompt
(
"Enter your Name"
,
"Name"
);
var
t
=
document
.
getElementById
(
"div1"
);
t
.
innerHTML
=
"<h1>"
+
name
+
"</h1>"
;
}
function
myFunction2
(){
var
name
=
document
.
getElementById
(
"input1"
).
value
;
var
div
=
document
.
getElementById
(
"div2"
);
div
.
innerHTML
=
"<h1>"
+
name
+
"</h1>"
;
}
</script>
</body>
</html>
Please
register
or
login
to post a comment