Element.setAttribute

Element setAttribute(string name, string value) @scriptable

Sets an attribute. Returns this for easy chaining