18 lines
452 B
JavaScript
18 lines
452 B
JavaScript
{a13d4329c63b5270ab101628f4732be1661478e1 true 452 script.js 0xc0030c5e30}
const btn = document.getElementById("btn");
|
|
const container = document.getElementById("container");
|
|
|
|
btn.addEventListener("click", () => {
|
|
createNotification();
|
|
});
|
|
function createNotification() {
|
|
const notification = document.createElement("div");
|
|
notification.classList.add("test");
|
|
|
|
notification.innerText = "Warning..";
|
|
|
|
container.appendChild(notification);
|
|
|
|
setTimeout(() => {
|
|
notification.remove();
|
|
}, 3000);
|
|
} |