title: javascript onclick to display time and date in a paragraph or not
body: <p>I'm trying to get the date to appear in an empty paragraph with an ID when I click on a button. So far no luck. Don't mind if I cant get it to appear in the paragraph but just want to know how to make it appear when I click the button thanks in advance.<br>
  sorry if its a dumb one,<br>
  I have got the alert working on click but just can not seem to figure this one out
  <img src="https://i.stack.imgur.com/3kKua.png" alt="enter image description here"></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;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Lets Practice Some Code&lt;/title&gt;
  
  &lt;link rel="stylesheet" type="text/css" href="/Users/Matteveli/Desktop/javascript practice/style/style.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div&gt;&lt;h1 id="topTitle"&gt; Time and date Test&lt;/h1&gt;&lt;/div&gt;
  
  &lt;div&gt;&lt;button id="alerter"&gt;click Me to make an alert pop up.&lt;/button&gt;&lt;/div&gt;
  
  &lt;p id="empty"
  
  &gt;&lt;/p&gt;&lt;div&gt;&lt;button id="timeAndDate"&gt;click Me to display time and date&lt;/button&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript" src="/Users/Matteveli/Desktop/javascript practice/javascript/funtionality.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;footer&gt;
  &lt;/footer&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </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-js lang-js prettyprint-override"><code>var alerterButton = document.getElementById("alerter");
  var dateButton = document.getElementById("timeAndDate");
  var emptyP = document.getElementById("empty");
  var d = new Date();
  
  // for the first click that we have working....  " THE ALERT "
  //a link to function was called then the function was made
  // as below 
  alerterButton.onclick = myClickHandler;
  
  function myClickHandler() {alert("the document was clicked")};
  
  /// TIME AND DATE ???
  
  dateButton.onclick = emptyP.innerHTML=d;
  
  function showMeTheDate() {emptyP.innerHTML+d}; </code></pre>
  </div>
  </div>
  </p>
  
  <p>any help greatly appreciated.<br>
  thanks in advance. </p>