<button id="id1">1</button>
<button id="id2">2</button>
<button id="id3">3</button>
<button id="id4">4</button>
<button id="id5">5</button>
<br>
<output></output>
output {
  display: block;
  width: 50vw;
  padding: 4px;
  border: 1px solid #CCC;
  margin-top: 10px;
}
const output = document.querySelector('output');
const onClick = e => {
  if (output.textContent.length > 1e3) output.textContent = '';
  output.textContent += e.target.innerText + ' ';
}
document.querySelectorAll('button').forEach(btn => btn.addEventListener('click', onClick));

let i = 1;
const trigger = () => {
  document.getElementById('id' + i).click();
  if (++i > 5) i = 1; // 1..5
  setTimeout(trigger, 750);
}

trigger();

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.