add_tag#

HTML.add_tag(tag: str, value: str | None = None) None#

Add or update a single tag.

If a tag with the same key already exists, it is removed before adding the new one.

Parameters:
tagstr

Tag key.

valuestr or None, optional

Tag value. If omitted, the tag is stored as a bare key without =value.