<div class="alert-box">
<p>Alert 박스</p>
<button type="button" onclick="close()">닫기</button>
</div>
<button type="button" onclick="open()">열기</button>
<script>
function open(){
document.querySelector('.alert-box').style.display = 'block'
}
function close(){
document.querySelector('.alert-box').style.display = 'none'
}
</script>
/////////////
.alert-box{
background: rgb(184, 184, 253);
color: blue;
padding: 20px;
border-radius: 5px;
display: none;
}
JavaScript / jQuery 입문과 웹 UI개발 4강에서 똑같이 따라한다음 open 버튼을 누르면 display 가 block이 되어야하는데
열기 버튼을 누르면 html 자체가 사라집니다 ㅠㅠ vscode를 사용중이며 열기 버튼 누를 시 라이브서버의 링크주소도 변경되는데 이런경우엔 어떻게 해야할까요 개발자도구로 봐도 html이 싹 사라져있네요