* 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)
| 132 | * @return The modified element. |
| 133 | */ |
| 134 | updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null { |
| 135 | if (!tag) return null; |
| 136 | selector = selector || this._parseSelector(tag); |
| 137 | const meta: HTMLMetaElement = this.getTag(selector)!; |
| 138 | if (meta) { |
| 139 | return this._setMetaElementAttributes(tag, meta); |
| 140 | } |
| 141 | return this._getOrCreateElement(tag, true); |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * Removes an existing `<meta>` tag element from the current HTML document. |
no test coverage detected