if(document.getElementById('page').scrollHeight < document.getElementById('page').offsetHeight) {...} else { document.getElementById('scroll-up').style.display = 'none'; }