void serializeValueToAttribute(value, String attribute, [Element node])

Sets a typed value to an HTML attribute on a node.

This method calls the serialize method to convert the typed value to a string. If the serialize method returns undefined, the attribute will be removed (this is the default for boolean type false).

Source

void serializeValueToAttribute(value, String attribute, [Element node]) {
  jsElement.callMethod(
      'serializeValueToAttribute', [convertToJs(value), attribute, node]);
}