JS: add getter for Element.classList (#553)

This commit is contained in:
Ivan Hetman 2021-01-11 11:12:20 +02:00 committed by GitHub
parent 660214aefd
commit 66ce993019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@ import org.teavm.jso.dom.events.KeyboardEventTarget;
import org.teavm.jso.dom.events.LoadEventTarget;
import org.teavm.jso.dom.events.MouseEventTarget;
import org.teavm.jso.dom.events.WheelEventTarget;
import org.teavm.jso.dom.types.DOMTokenList;
import org.teavm.jso.dom.xml.Element;
import org.teavm.jso.dom.xml.Node;
import org.teavm.jso.dom.xml.NodeList;
@ -150,6 +151,9 @@ public interface HTMLElement extends Element, ElementCSSInlineStyle, EventTarget
@JSProperty
void setClassName(String className);
@JSProperty
DOMTokenList getClassList();
default HTMLElement withAttr(String name, String value) {
setAttribute(name, value);
return this;