<style>.red {color: red}</style>
<p class="hello">Lorem ipsum dolor sit amet, consectetur</p>
<p class="hello">Sapiente in delectus dolorem reiciendis ditii</p>
<p class="hello">Quis dolore autem voluptatibus repellat</p>
<script>
(function (nameClass, addThis) {
var classes = document.getElementsByClassName(nameClass);
for(var i = 0; i < classes.length; i++) {
setTimeout(addClass.bind(false, classes[i], addThis), i*2000 + 2000);
}
})("hello", "red");
function addClass(o, c){
var re = new RegExp("(^|\\s)" + c + "(\\s|$)", "g")
if (re.test(o.className)) return
o.className = (o.className + " " + c).replace(/\s+/g, " ").replace(/(^ | $)/g, "");
}
</script>