function counter(ms, className){
let counter = 0;
let interval = setInterval(() => {
document.querySelector(className).innerHTML = ++counter;
counter === 100 ? clearInterval(interval) : false;
}, ms)
}
counter(100, '.res')