title: How do you make a working clock with JavaScript?
body: <p>Here's my broken spaghetti JavaScript/jQuery code:</p>
  
  <pre><code>$(document).ready(function(){
      var d = new Date;
      var hours = Date.getHours();
      var mins = Date.getMinutes();
      if(hours &gt; 12){
          var hour = (hours - 12);
          var ampm = "PM";
      }
      else{
          var hour = hours;
          var ampm = "AM";
      }
      var time = hour + ":" + mins, ampm
      $("h1").html(time);
      });
  });
  </code></pre>
  
  <p>Can you help me make a working clock?</p>