<!DOCTYPE html>
<html>
<head>
<title>Jayun's Home</title>
<link rel ="stylesheet" type = "text/css" href = "myhome.css">
</head>
<body>
<br><br><br><br><br>
<center><img src = "Main.jpg"></center>
<div id = "event"><span id = "motto">"Always keep the faith"</span>
<img src = "mottoex.png" id = "mottoex" visibility = "hidden"></div>
<script type = "text/javascript">
document.getElementById("event").onmouseover = mottoexplain;
function mottoexplain(){
var dom = document.getElementById(mottoex);
dom.visibility = "visible";
}
</script>
</body>
</html>
div id = "event" 쪽에 마우스를 올려 두면 mottoex.png의 hidden이 visible로 바뀌어 사진이 뜨도록 하고 싶은데
Uncaught TypeError: Cannot set property 'visibility' of null
이런 오류가 자꾸떠용...왜일까요ㅠㅠ