<style>
div button {
visibility: hidden;
}
</style>
<div>
<button>1</button>
<button>2</button>
<button>3</button>
</div>
<script>
window.onload = function () {
var div = document.body.children[0];
var elems = div.children;
var len = elems.length;
var n, m = 0;
setInterval(function () {
n = m - 1;
if (n < 0) {
n = len - 1;
}
elems[n].style.visibility = 'hidden';
elems[m].style.visibility = 'visible';
m++;
if (m > len - 1) {
m = 0;
}
}, 1000);
}
</script>