JS - check current time and date with Date()

0 votes
added Aug 15, 2019 in Javascript by lcjr First Warrant Officer (11,930 points)
<button onclick="document.getElementById('eltime').innerHTML = Date()">The time is?</button>
<div id="eltime">
  <!--output example: Thu Aug 15 2019 14:10:36 GMT+0800 (Malaysia Time)-->


lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.