13 lines
368 B
JavaScript
13 lines
368 B
JavaScript
|
document.querySelectorAll(".floating>input").forEach(e => {
|
||
|
function checkState() {
|
||
|
if (e.value !== "") {
|
||
|
if (e.classList.contains("used")) return;
|
||
|
e.classList.add("used")
|
||
|
} else {
|
||
|
if (e.classList.contains("used")) e.classList.remove("used")
|
||
|
}
|
||
|
}
|
||
|
|
||
|
e.addEventListener("change", () => checkState())
|
||
|
checkState()
|
||
|
})
|