stronghasu / js-study

0 stars 0 forks source link

4번강의핀 #7

Open SINIIPIN opened 10 months ago

SINIIPIN commented 10 months ago

<div class="alert-box" id="alert"> <p id="text">알림창</p> <button onclick="toggleAlert('none');">버튼</button> </div> <button onclick="toggleAlert('block', '아이디입력하세요.');">버튼1</button> <button onclick="toggleAlert('block', '비번입력하세요.');">버튼2</button>

<script> function toggleAlert(empty, empty2){ document.getElementById('alert').style.display = empty; document.getElementById('text').innerHTML = empty2; } </script>