set_attr(HTMLObject, Attribute, Value) sets the attribute Attribute of HTMLObject to Value. set_attr always succeeds, unless HTMLObject is the document object, in which case the predicate fails without returning an error.