<script>
function ready() {
alert('DOM이 준비되었습니다!');
// 이미지가 로드되기 전에 실행
alert(`이미지 사이즈: ${img.offsetWidth}x${img.offsetHeight}`);
}
document.addEventListener("DOMContentLoaded", ready);
</script>
<img id="img" src="https://en.js.cx/clipart/train.gif?speed=1&cache=0">
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.