Rabu, 19 Maret 2014

Belajar Array ( hari.html )

Yanng Posting Unknown di 02.27
<head>
        <title>Belajar Array</title>
            <script type="text/javascript">
           
            var    nama_hari = new Array("Hari","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","minggu");
            function hari()
            {
                var angka = document.getElementById("text_hari").value;
                document.getElementById("text_hasil").value = nama_hari[angka];
            }
         
            </script>
    </head>
   
    <body bgcolor=pink>
    Ketik Angka  = <input type=text id=text_hari> <br>
    <input type=button value=Cari onclick='hari();'> <br>
    Hasil Hari= <input type=text id=text_hasil>
    </body>
</html>

0 komentar:

Posting Komentar

 

SI MATA SEMUT Template by Ipietoon Blogger Template | Gift Idea