Files
MaszToZadanieDomowe.com/assets/js/akordeon.js
2025-09-21 20:30:37 +02:00

29 lines
669 B
JavaScript

class Akordeon extends HTMLElement {
constructor() {
super();
this._internals = this.attachInternals();
}
get collapsed() {
return this._internals.states.has("hidden");
}
set collapsed(flag) {
if (flag) {
// Existence of identifier corresponds to "true"
this._internals.states.add("hidden");
} else {
// Absence of identifier corresponds to "false"
this._internals.states.delete("hidden");
}
}
connecterCallback() {
}
attributeChangedCallback(atrybut, poprzednio, obecnie) {
}
}
customElements.define("akordeon", Akordeon);