phuocng / html-dom

Common tasks of managing HTML DOM with vanilla JavaScript. Give me 1 ⭐if it’s useful.
https://phuoc.ng/collection/html-dom
MIT License
6.52k stars 459 forks source link

Update get-or-set-the-cursor-position-in-a-content-editable-element.mdx #288

Open saona-raimundo opened 7 months ago

saona-raimundo commented 7 months ago

Thanks for this post! After going through it, I wanted to suggest two small changes.

There are two changes: 1) simplify the creation of a range (create a new range instead of cloning one, since we do not use any information from the clone) 2) A typo fix in a html closing element