code: def setNamedItem(self, item: Attr) -> None:
          
          from wdom.web_node import WdomElement
          if not isinstance(item, Attr):
              raise TypeError('item must be an instance of Attr')
          if isinstance(self._owner, WdomElement):
              self._owner.js_exec('setAttribute', item.name,  # type: ignore
                                  item.value)
          self._dict[item.name] = item
          item._owner = self._owner
docs: Set ``Attr`` object in this collection.