(JavaScript) 이벤트 및 DOM 스타일 로드 및 언로드
로드 이벤트 <!DOCTYPE html> <html> <head> <meta charset=”utf-8″> <meta http-equiv=’X-UA-Compatible’ content=”IE=edge”> <title>Page Title</title> <meta name=”viewport” content=”width=device-width, initial-scale=1″> <script> // 아직 해당 태그를 읽지 않았기 때문에 제대로 된 값이 나오지 않는다. let h1 = document.getElementById(“h1”); console.log(h1); //모든 작업이 로드가 완료된 이후에 실행됨. 가장 마지막에 출력. window.onload = function() { console.log(document.getElementById(“h1”), 2); } </script> </head> <body> <h1 … Read more