From d1647e7e723a0d22c0d58e46ae157378611503e6 Mon Sep 17 00:00:00 2001 From: taoqf Date: Thu, 6 Feb 2020 11:53:55 +0800 Subject: [PATCH] :pencil: add/remove api --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1a966f5..0f66e3d 100644 --- a/README.md +++ b/README.md @@ -134,30 +134,30 @@ Get first 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. - -### HTMLElement#setAttributes(attributes: Attributes) - -Replace all the current attributes by the provided attribute set. +Get `key` attrubte. ### HTMLElement#toString() + Same as [outerHTML](#htmlelementouterhtml) ### HTMLElement#innerHTML + Get innerHTML. ### HTMLElement#outerHTML + Get outerHTML. ### HTMLElement#set_content(content: string | Node | Node[]) + Set content. **Notice**: Do not set content of the **root** node.