if(i >= setting2){ document.getElementById('number').innerHTML = setting2; } else if(i >= setting1){ document.getElementById('number').innerHTML = setting1; }