-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhat.js
More file actions
18 lines (18 loc) · 765 Bytes
/
Copy pathwhat.js
File metadata and controls
18 lines (18 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const submitBtn = document.getElementById('submit-btn');
submitBtn.onmouseover = () => {
submitBtn.textContent = '取消并删除所有内容';
submitBtn.classList.replace('bg-black', 'bg-red-600');
};
submitBtn.onmouseout = () => {
submitBtn.textContent = '发送';
submitBtn.classList.replace('bg-red-600', 'bg-black');
};
submitBtn.onclick = () => {
const input = submitBtn.previousElementSibling;
input.value = '';
const originalText = submitBtn.textContent;
submitBtn.textContent = '已成功销毁信息';
setTimeout(() => {
submitBtn.textContent = originalText;
}, 2000);
};