title: Button to be able to input current time when clicked
body: <p>I'm fairly new to scripting so please be patient and gentle with me. I have the following code which fetches the time and allows me to pass it to a database (MySQL) when another button is pressed.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form action="includes/data_input.inc.php" method="POST"&gt;
  
      &lt;!--  button - Start Timer --&gt;
      &lt;timer&gt;
   &lt;input id="starttime_button" name = "starttime_button" type="button" value="Start Timer"
                 onclick="document.getElementById('starttime').value = new Date().toLocaleTimeString(navigator.language, {hour: '2-digit', minute:'2-digit', second:'2-digit'})" /&gt;
   &lt;input type="time" id="starttime" name="starttime" value="" /&gt;
      &lt;/timer&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This works ok in Firefox, but not in Google Chrome. Is there a generic code that will let me do this, please?</p>
  
  <p>I have tried many things including this, but it's not quite working ...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form action="includes/data_input.inc.php" method="POST"&gt;
  
      &lt;!--  button - Start Timer --&gt;
      &lt;timer&gt;
   &lt;input id="starttime_button" name = "starttime_button" type="button" value="Start Timer"
                 onclick="getElementById('starttime').Date('i:s')" /&gt;
          &lt;p type="time" id="starttime" name="starttime" value="" &gt;&lt;/p&gt;
      &lt;/timer&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>In both cases, the main form continues and is terminated with <code>&lt;/form&gt;</code></p>
  
  <p>Thanks in advance.</p>
  
  <p>Brian.</p>