set_attribute method

set_attribute(name, value)

Adds a new attribute. If an attribute with that name is already present in the element, its value is changed to be that of the value parameter.

def set_attribute(self, name, value):
    ...
ParameterTypeDescription
namestrThe attribute name.
valuestrThe attribute value.

See Also