0
我有自動隱藏消息的代碼,如何更改超時功能以關閉點擊?
setTimeout(function() {
document.getElementById('err').style.display = 'none';
}, 5000);
我需要這樣,當我點擊一個按鈕,它關閉上點擊修改此代碼。
下面是爲div
的HTML代碼:
<div class='alert alert-warning alert-dismissible' role='alert'>
<button type='button' class='close' data-dismiss='alert'
aria-label='Close'><span aria-hidden='true'>×</span></button>
<h4 id=err>Mail not sent</h4>
</div>
我需要關閉div ......! –
製作一個'功能'並在'click'上將其稱爲該功能。 –
用鏈接''替代'button'作爲引導提供了關閉警報消息的默認功能。像這樣做'×' –