This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.



Smartphone icons created by Freepik - Flaticon

JS HTML Events

The onclick Attribute

Click the button to display the date.

//onclick button event
 onclick="displayDate()"

//onclick function
function displayDate() {
  document.getElementById("demo").innerHTML = Date();
}