Initial commit
This commit is contained in:
20
js/button.js
Normal file
20
js/button.js
Normal file
@@ -0,0 +1,20 @@
|
||||
addEventListener("load", () => {
|
||||
const onAnimationFinished = (e) => {
|
||||
e.target.remove();
|
||||
};
|
||||
const onClick = (e) => {
|
||||
const clickElement = document.createElement("div");
|
||||
clickElement.className = "click";
|
||||
clickElement.addEventListener("animationend", onAnimationFinished);
|
||||
e.target.appendChild(clickElement);
|
||||
};
|
||||
for (const btn of document.getElementsByClassName("btn")) {
|
||||
btn.addEventListener("focusin", () => {
|
||||
console.log("IN");
|
||||
});
|
||||
btn.addEventListener("focusout", () => {
|
||||
console.log("OUT");
|
||||
});
|
||||
btn.addEventListener("click", onClick);
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user