@@ -120,6 +120,16 @@ class DOM {
|
||||
static bool hasClass(Element element, String classname) =>
|
||||
element.classes.contains(classname);
|
||||
|
||||
static setStyle(Element element, String stylename, String stylevalue) {
|
||||
element.style.setProperty(stylename, stylevalue);
|
||||
}
|
||||
static removeStyle(Element element, String stylename) {
|
||||
element.style.removeProperty(stylename);
|
||||
}
|
||||
static getStyle(Element element, String stylename) {
|
||||
return element.style.getPropertyValue(stylename);
|
||||
}
|
||||
|
||||
static String tagName(Element element) => element.tagName;
|
||||
|
||||
static Map<String, String> attributeMap(Element element) =>
|
||||
|
||||
@@ -139,6 +139,15 @@ export class DOM {
|
||||
static hasClass(element:Element, classname:string) {
|
||||
return element.classList.contains(classname);
|
||||
}
|
||||
static setStyle(element:Element, stylename:string, stylevalue:string) {
|
||||
element.style[stylename] = stylevalue;
|
||||
}
|
||||
static removeStyle(element:Element, stylename:string) {
|
||||
element.style[stylename] = null;
|
||||
}
|
||||
static getStyle(element:Element, stylename:string) {
|
||||
return element.style[stylename];
|
||||
}
|
||||
static tagName(element:Element):string {
|
||||
return element.tagName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user