How to display the current date in a webpage using HTML and JavaScript

1 Answer

0 votes
<div>
   <p id="dateid"></p>
</div>



<!--

Thu Jun 24 2021

-->
const dt = document.getElementById('dateid');

dt.textContent = new Date().toDateString();
  
   
   
    
/*
run:
    

    
*/

  

 



answered Jun 24, 2021 by avibootz
...