index.html
993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<button onclick="myFunction()">Try it</button>
<button onclick="goLocation('naver')">NAVER</button>
<button onclick="goLocation('daum')">DAUM</button>
<script>
document.write("<div id='name'><a href='123'>link</a></div>");
var x = document.getElementById("name");
// alert(x.innerHTML);
x.innerHTML = "<a href='http://naver.com'>link</a>";
function myFunction() {
var myWindow = window.open("", "_self", "");
myWindow.document.write("<img width='500' height='300' src='test.png'/>");
}
function goLocation(where) {
if (where === "naver") {
location.assign("http://naver.com");
} else if (where === "daum") {
location.assign("http://daum.net");
}
}
// var name = prompt("Enter Your Name", "Name");
// document.write("Your name is " + name + " .");
</script>
</body>
</html>