1. Pertama sobat buka dulu software web editor seperti adobe dreamweaver, front page atau kalau tidak punya semua buka saja notepad.
  2. Terus ketikkan script di bawah ini pada dokumen, gunakan mode HTML. Langsung copy paste aja biar cepet yah.
    <html>
    <head>
    <title>Jam Digital</title>
    <script type="text/javascript">
    window.setTimeout("renderDate()",1);
    days = new Array(
    "Minggu","Senin","Selasa","Rabu","Kamis","Jum'at","Sabtu"
    );
    months = new Array(
    "Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"
    );
    function renderDate(){
    var mydate = new Date();
    var year = mydate.getYear();
    if (year < 2000) {
    if (document.all)
    year = "19" + year;
    else
    year += 1900;
    }
    var day = mydate.getDay();
    var month = mydate.getMonth();
    var daym = mydate.getDate();
    if (daym < 10)
    daym = "0" + daym;
    var hours = mydate.getHours();
    var minutes = mydate.getMinutes();
    var seconds = mydate.getSeconds();
    var dn = "AM";
    if (hours >= 12) {
    dn = "PM";
    hours = hours - 12;
    }
    if (hours == 0)
    hours = 12;
    if (minutes <= 9)
    minutes = "0" + minutes;
    if (seconds <= 9)
    seconds = "0" + seconds;
    document.getElementById("jam").innerHTML = "<B>"+days[day]+" "+daym+" "+months[month]+" "+year+"</B> | "+hours+":"+minutes+":"+seconds+" "+dn;
    setTimeout("renderDate()",1000)
    }
    </script>
    </head>
    <body onLoad="renderDate()">
    <div id="jam" style="background:#00CC33;border:1px dashed #000;padding:5px;width:auto;" align="center">
    </div>
    </body>
    </html>
  3. Kalau sudah, simpan dokumen tersebut dengan nama yang sobat inginkan dan diberi ekstensi (.html) misalnya jam_digital.html
  4. Terakhir buka dan jalankan file yang telah sobat simpan tadi menggunakan browser.
  5. Jam Digital siap disajikan, selesai deh.
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

2 Responses to this post

  1. achmad wildan akfiansyah on 14 Februari 2013 pukul 22.26

    cara mengubah dokumen di notepad jadi .html gimana?

  2. Unknown on 24 Desember 2013 pukul 19.21
    Komentar ini telah dihapus oleh pengarang.

Leave a comment

Diberdayakan oleh Blogger.