Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Love the website, too bad it doesn't use nor mention the new and much improved DOM APIs.

This swap function is just `a.replaceWith(c, d, e, …)` in DOM4

https://htmldom.dev/swap-two-nodes

If you haven't seen this before, I highly suggest looking into it.

https://github.com/WebReflection/dom4 (I can't find any articles about DOM 4, so this polyfill’s readme will have to do)



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: