* Modifies an existing ` ` tag element in the current HTML document. * @param tag The tag description with which to replace the existing tag content. * @param selector A tag attribute and value to match against, to identify * an existing tag. A string in the format `"tag_attribute=`val
(tag: MetaDefinition, selector?: string)
| 124 | * @return The modified element. |
| 125 | */ |
| 126 | updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null { |
| 127 | selector ??= parseSelector(tag); |
| 128 | const meta = this.getTag(selector); |
| 129 | if (meta) { |
| 130 | setMetaElementAttributes(tag, meta); |
| 131 | return meta; |
| 132 | } |
| 133 | return this._getOrCreateElement(tag, true); |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Removes an existing `<meta>` tag element from the current HTML document. |
no test coverage detected