Skip to content

Conversation

@Maluscat
Copy link

Hi,
First of all, thanks for writing this library, it's a really clever yet simple DOM abstraction!

I implemented some methods that I felt were missing from the HTMLElement. They are commonly used in the actual DOM and thus provide better compatibility with other backend DOM abstractions as well (in my case, I switched from deno-dom to node-html-parser, and I had to shim some of these).

  • get children() (only HTMLElement children)
  • get firstElementChild()
  • get lastElementchild()
  • get childElementCount()
  • before(...nodes)
  • after(...nodes)
  • prepend(...nodes)
  • append(...nodes)

The last four are now the base operations. insertAdjacentHTML and appendChild use them and they are tested accordingly.

README documentation is also included ✌️

@taoqf taoqf merged commit d903da2 into taoqf:main Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants