<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h4 id="test">안녕하세요</h4>
<script>
$("#test").html("안녕");
</script>
<div class="alert" id="alert2">
<p id="title">alert 박스</p>
<button id="close">닫기</button>
</div>
<button onclick="openalert('block', '아이디를 입력하세요')">버튼1</button>
<button onclick="openalert('block', '비밀번호를 입력하세요')">버튼2</button>
<script>
function openalert(bt, description) {
document.getElementById("alert2").style.display = bt;
document.getElementById("title").innerHTML = description;
}
document.getElementById("close").addEventListener("click", function () {
document.getElementById("alert2").style.display = "none";
});
</script>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"
></script>
</body>
</html>
이렇게 작성하였는데 안녕하세요가 안녕으로 바뀌질 않습니다