title: How to get input from a calendar and print the date using JavaScript and HTML
body: <p>First of all, I'm very new to using JavaScript with HTML. Right now I have a calendar where a user can select the date they want. When selected I want the Date to print on the website for now. So if user selects 10/13/2019, I want the 10/13/2019 to print in my &lt;p id=&quot;demo&gt;. I want to print out the date right when the user clicks the date that they want. Any tips on how to do this? Here is what I have right now.</p>
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
     &lt;script src=&quot;https://cdn.syncfusion.com/ej2/dist/ej2.min.js&quot;&gt;&lt;/script&gt;
     &lt;link href=&quot;https://cdn.syncfusion.com/ej2/material.css&quot; rel=&quot;stylesheet&quot;&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div style= text-align:center&gt;
      &lt;input id=&quot;datepicker&quot;  onclick=&quot;print()&quot; type=&quot;text&quot;&gt;
      &lt;/div&gt;
  
  &lt;p&gt; Testing my Calender input &lt;/p&gt;
  &lt;p id=&quot;demo&quot;&gt;&lt;/p&gt;
  
  
  &lt;script type=&quot;text/javascript&quot;&gt;
  
      var datepicker = new ej.calendars.DatePicker({ width: &quot;300px&quot; });
      datepicker.appendTo('#datepicker');
  
  
  
      function print()
      {
        var input = document.getElementById(&quot;datepicker&quot;).value;
  
        document.getElementById('demo') = input;
  
      }
  
  &lt;/script&gt;
  
  
  
   &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>