title: how to display date using javascript?
body: <h2>as i try the below javascript code to display date</h2>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;h1&gt; javascript&lt;/h1&gt;
  &lt;button type="button" onclick=document.getElementById('demo').innerHTML=Date()"&gt;click me to display date and time.&lt;/button&gt;
  &lt;p id="demo"&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>