위처럼 쓸 수 있다는 것을 기억하자.
과제로 제출했던거 기록
const title = document.querySelector("div.hello:first-child h1");
let currentWindowSize = window.outerWidth
function handleWindowResize() {
currentWindowSize = window.outerWidth;
handleWindowCurrentsize();
if(currentWindowSize < 760){
document.body.style.backgroundColor = "blue"
} else if(currentWindowSize > 1300) {
document.body.style.backgroundColor = "yellow"
} else {
document.body.style.backgroundColor = "purple"
}
}
function handleWindowCurrentsize(){
title.innerText = "my current size is " + currentWindowSize
}
window.addEventListener("resize", handleWindowResize);