30명의친구를 만들어 보겠습니다.






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
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title> 동적으로 테이블 만들기
</title>
</head>
 
<body onload="makeFriends()">
   <h2>내 친구 나열하기</h2>
 
   <script type="text/javascript">
      function makeFriends() {
         var myFriends = window.prompt("친구가 몇 명인가요?""");
         
         for(var i = 0; i < parseInt(myFriends); i++)
         {
            var textBox = document.createElement("input");
            var newLine = document.createElement("br");
            
            textBox.type = "text";
            
            document.body.appendChild(textBox);
            document.body.appendChild(newLine);
 
         }
      }
   </script>
</body>
</html>
cs



'프로그래밍 > JAVA' 카테고리의 다른 글

[JAVA] final  (1) 2018.08.20
[JAVA] String 타입  (8) 2018.08.20
[JAVA]상속-부모클래스, 자식클래스  (5) 2018.08.18
[JAVA]this 레퍼런스  (2) 2018.08.17
[JAVA]접근 지정자를 알아보자!  (2) 2018.08.17

+ Recent posts