본문 바로가기

   
Programming/Javascript

Javascript 대화상자 종류

반응형

실행화면


소스

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

       <head>

             <title></title>

             <meta name="generator" content="editplus" />

             <meta name="author" content="김종현" />

             <script type="text/javascript">

             <!--

                    function Test1() {

                           //대화상자 3

                           //브라우저 - 유저

                           alert("안녕~");

                    }

 

                    function Test2() {

                           var result = confirm("확실합니까?");

                           //alert(result);

 

                           if (result) {

                                 alert("통과~");

                           }

                           else {

                                 alert("바이~");

                           }

                    }

 

                    function Test3() {

                           var name = prompt("이름을 입력하세요.", "이곳에 입력하세요.");

 

                           alert("안녕하세요~ " + name + "");

                    }

             //-->

             </script>

       </head>

 

       <body>

             <!-- Ex06.htm -->

             <input type="button" value="대화상자" onclick="Test1();" />

             <hr />

             <input type="button" value="대화상자" onclick="Test2();" />

             <hr />

             <input type="button" value="대화상자" onclick="Test3();" />

       </body>

</html>

 

 


반응형