appendToAttribute method
Appends value
to attribute of name
.
Useful for attributes like class
and style
.
Implementation
DOMElement appendToAttribute(String name, Object? value) {
// ignore: prefer_collection_literals
_attributes ??= LinkedHashMap();
var attr = getAttribute(name);
if (attr == null) {
return setAttribute(name, value);
}
if (attr.isCollection) {
attr.appendValue(value);
} else {
attr.setValue(value);
}
return this;
}