<!DOCTYPE html>
<html lang="ko">
<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>
</head>
<body>
<div class="alert alert-danger">
<span id="count">5</span>์ด ๋ค ๐ฅ
</div>
<script>
const counter = document.querySelector('#count');
const alert = document.querySelector('.alert');
let count = 5;
let timerEnd = setInterval(function() {
alert.remove('.alert');
}, 5000);
setInterval(function() {
count --;
if (count >= 0) {
counter.innerHTML = count;
}
}, 1000);
</script>
</body>
</html>