HTML DOM Event type Property

The HTML DOM Event type property returns a string corresponding to the event’s type such as click, keypress, load, or touchend.

Following is the syntax −

Returning number of seconds a transition has run −


Let us see an example of Event type property −


 Live Demo

<!DOCTYPE html>
<title>HTML DOM Event type</title>
   form {
      margin: 0 auto;
      text-align: center;
   * {
      padding: 2px;
   input[type="button"] {
      border-radius: 10px;
   .playArea {
      display: inline-block;
      border-radius: 50%;
      background-color: #DC3545;
      width: 50px;
      height: 50px;
      border: 3px solid #AC3509;
      transition: all 1.3s ease;
   .clickStyle {
      transform: scale(1.5);
   .touchstartStyle {
      transform: translateX(50px);
         <div class="playArea"></div><br>
         <div id="divDisplay"></div>
   var divDisplay = document.getElementById("divDisplay");
   var playDisplay = document.getElementsByClassName("playArea")[0];
   var TranslateXSelect = document.getElementById("TranslateXSelect");
   var ScaleSelect = document.getElementById("ScaleSelect");
   function getEventType(event) {
      if(event.type === 'click'){
            divDisplay.textContent = 'Event Fired: '+event.type;
      } else if(event.type === 'touchstart'){
         divDisplay.textContent = 'Event Fired: '+event.type;
   playDisplay.addEventListener("click", getEventType);
   playDisplay.addEventListener("touchstart", getEventType);


Before clicking the div element −

After clicking the div element −

After touching the div element −