내 친구 나열하기

2019. 9. 20. 10:44나의 노력/WEB

<html>
  <head>
    <title>내 친구 나열하기</title>
     <script language="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>
</head>

<body onload="makeFriends()">
  <h2>내 친구 나열하기.</h2>
  </body>
</html>

 

 

'나의 노력 > WEB' 카테고리의 다른 글

함수로 배경 색 전환  (0) 2019.09.20
라디오 박스  (0) 2019.09.20
HTML 문서에 시계 표시하기  (0) 2019.09.20
회원가입 폼 만들기 - HTML  (0) 2019.09.10
setInterval의 활용  (0) 2019.09.09