I would like the output to be JUST the TIME. Currently it also displays the date. How do i fix this.

<html>
 <head>
 <title> Start and stop a clock </title>
 </head>
 <body>
 <input type="text" size= "60" id="theclock" />
 <script type="text/javascript">
 var setIntervalID = window.setInterval("setClock()",1000);
 function setClock()
 {
 var now = new Date();
 document.getElementById("theclock")…
 }
 function stopClock()
 {
 clearIntervalID=window.clearInterva…
 }
 </script>
 <button onclick="stopClock()">Stop</button>
 </body>
 </html>

First of all: this is a Javascript issue... so please, next time, add it to the javascript Thread. Thanks.

Nevertheless:
Use this code after you initialised date "now":

hour = now.getHours();
  min = now.getMinutes();
  sec = now.getSeconds();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.