You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
코드를 짜고 실행 시 드롭다운 하위 메뉴가 나오지 않습니다.
페이지 요소검사 결과 캡쳐한 부분과 같은 오류가 발생하는데, 함수의 내용을 지속적으로 바꿔도 일단 변하지 않습니다.
실행환경
윈도우/ 크롬에서 실행
<!doctype html><html><head><title>Jessie</title><metacharset="utf-8"><linkrel="stylesheet" href="style.css"><linkrel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"><scriptsrc="colors.js" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script></head><body><divclass="navbar"><divclass="dropdown"><buttonclass="dropbtn" onclick="myFunction()">About_Jessie
<iclass="fa fa-caret-down"></i></button><divclass="dropdown-content" id="myDropdown"><ahref="#">Link 1</a><ahref="#">Link 2</a></div></div><ahref= "2.html">Likes</a><ahref= "3.html">Portfolio</a><ahref= "4.html">Contacts</a></div>
-----------------------------------------------------------------colors.js 파일-----------
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
// Close the dropdown if the user clicks outside of it
window.onclick = function(e) {
if (!e.target.matches('.dropbtn')) {
var myDropdown = document.getElementById("myDropdown");
if (myDropdown.classList.contains('show')) {
myDropdown.classList.remove('show');
}
}
}
캡쳐
The text was updated successfully, but these errors were encountered:
증상
코드를 짜고 실행 시 드롭다운 하위 메뉴가 나오지 않습니다.
페이지 요소검사 결과 캡쳐한 부분과 같은 오류가 발생하는데, 함수의 내용을 지속적으로 바꿔도 일단 변하지 않습니다.
실행환경
윈도우/ 크롬에서 실행
캡쳐
The text was updated successfully, but these errors were encountered: