<html>
<body>
</body>
<script>
window.addEventListener('scroll',function(){
let one= document.querySelector('body').scrollTop; //현재 웹페이지 스크롤양
let two = document.querySelector('body').scrollHeight; //현재 웹페이지 실제높이
let three = document.querySelector('body').clientHeight; //현재 웹페이지 보이는 높이임
let exm = (one/(two-three))*100
document.querySelector('.hello').innerHTML = exm
</script>
</html>
바로 표시하기 귀찮아서 %로 구현했는데,
셀렉터를 body 할때만 제대로 나오고 html 로 할때는 NaN 입니다.
뭐때문에 그럴까요?