<aside> 💡 강의를 시작하기 전에
</aside>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1 id="fastcampus">안녕하세요.</h1>
</body>
</html>
short-cut
을 아시나요?live-server로 여시면 이런 화면 보실 수 있습니다. 우클릭 > open with live server
<script>
// 안녕하세요를 안녕 못한데로 바꿔줘!
document.getElementById("fastcampus").innerHTML = "안녕 못한데?";
</script>
대입연산자
라고 들어보셨습니까?JS로 화면 UI를 바꾸는 방법은 3단계만 거치면 됩니다.
<!DOCTYPE html>
<html>
<head>
<style>
#alertBox{
background-color: #c6c6c6;
border-radius: 10px;
font-weight: 800;
padding: 20px;
display: none;
}
</style>
</head>
<body>
<div id="alertBox">알림창임!</div>
<button class="show-alert" onclick="document.getElementById('alertBox').style.display = 'block'">알림창을 보여줘!</button>
</body>
</html>