attr method

String? attr(
  1. String name, [
  2. String? value
])

Implementation

String? attr(String name, [String? value]) {
  if (value == null) {
    return element?.getAttribute(name);
  }
  element?.setAttribute(name, value);
  return value;
}