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.
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()
(onlyHTMLElement
children)get firstElementChild()
get lastElementchild()
get childElementCount()
before(...nodes)
after(...nodes)
prepend(...nodes)
append(...nodes)
The last four are now the base operations.
insertAdjacentHTML
andappendChild
use them and they are tested accordingly.README documentation is also included :v: