mirror of
https://github.com/danbulant/node-html-parser
synced 2026-06-20 07:01:57 +00:00
📝 add/remove api
This commit is contained in:
parent
95d31ca155
commit
d1647e7e72
1 changed files with 10 additions and 10 deletions
20
README.md
20
README.md
|
|
@ -134,30 +134,30 @@ Get first child node
|
||||||
|
|
||||||
Get last child node
|
Get last child node
|
||||||
|
|
||||||
### HTMLElement#attributes
|
### HTMLElement#setAttribute(key: string, value: string)
|
||||||
|
|
||||||
Get attributes
|
Set `value` to `key` attribute.
|
||||||
|
|
||||||
### HTMLElement#rawAttributes
|
### HTMLElement#removeAttribute(key: string)
|
||||||
|
|
||||||
Get escaped (as-it) attributes
|
Remove `key` attribute.
|
||||||
|
|
||||||
### HTMLElement#setAttribute(key: string, value: string | null)
|
### HTMLElement#getAttribute(key: string)
|
||||||
|
|
||||||
Set `value` to `key` attribute. If `value` is null, remove the attribute instead.
|
Get `key` attrubte.
|
||||||
|
|
||||||
### HTMLElement#setAttributes(attributes: Attributes)
|
|
||||||
|
|
||||||
Replace all the current attributes by the provided attribute set.
|
|
||||||
|
|
||||||
### HTMLElement#toString()
|
### HTMLElement#toString()
|
||||||
|
|
||||||
Same as [outerHTML](#htmlelementouterhtml)
|
Same as [outerHTML](#htmlelementouterhtml)
|
||||||
|
|
||||||
### HTMLElement#innerHTML
|
### HTMLElement#innerHTML
|
||||||
|
|
||||||
Get innerHTML.
|
Get innerHTML.
|
||||||
|
|
||||||
### HTMLElement#outerHTML
|
### HTMLElement#outerHTML
|
||||||
|
|
||||||
Get outerHTML.
|
Get outerHTML.
|
||||||
|
|
||||||
### HTMLElement#set_content(content: string | Node | Node[])
|
### HTMLElement#set_content(content: string | Node | Node[])
|
||||||
|
|
||||||
Set content. **Notice**: Do not set content of the **root** node.
|
Set content. **Notice**: Do not set content of the **root** node.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue