Latihan Soal Online PPS Pemilu 2024

Klik tombol di bawah untuk mulai mengerjakan soal!

Related Posts:

Membuat Jam Digital pada blog dengan OpenAI

Untuk membuat jam Digital seperti di atas kamu dapat menggunakan kode HTML di bawah ini. 
<!-- HTML -->
<div id="digital-clock">
  <div class="clock-container">
    <div id="hours"></div>
    <div id="minutes"></div>
    <div id="seconds"></div>
  </div>
</div>
<!-- CSS -->
<style>
  #digital-clock {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    color: #fff;
    background-color: #333;
    padding: 20px;
    border-radius: 10px;
  }
  
  .clock-container {
    display: flex;
  }
  
  .clock-container div {
    margin: 0 10px;
  }
  
  #hours {
    color: #ff0000;
  }
  
  #minutes {
    color: #00ff00;
  }
  
  #seconds {
    color: #0000ff;
  }
</style>
<!-- JavaScript -->
<script>
  function updateClock() {
    var currentTime = new Date();
    var hours = currentTime.getHours();
    var minutes = currentTime.getMinutes();
    var seconds = currentTime.getSeconds();

    if (hours < 10) {
      hours = "0" + hours;
    }
    if (minutes < 10) {
      minutes = "0" + minutes;
    }
    if (seconds < 10) {
      seconds = "0" + seconds;
    }
    
    document.getElementById("hours").innerHTML = hours;
    document.getElementById("minutes").innerHTML = ":" + minutes;
    document.getElementById("seconds").innerHTML = ":" + seconds;
  }
  
  setInterval(updateClock, 1000);
</script>

 

Related Posts: