성준영

practice_13

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