JS - check current time and date with Date()

0 votes
184 views
added Aug 15, 2019 in Javascript by lcjr First Warrant Officer (11,850 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)-->
</div>

 

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