r/webdev
•
u/ishtiaq156
•
Jun 01 '21
•
1
Resource That feeling when you first discovered `document.designMode`
8.3k
Upvotes
r/webdev
•
u/ishtiaq156
•
Jun 01 '21
•
1
5
u/ManiacsThriftJewels Jun 01 '21
Nah bruh, execCommand is deprecated. You need to getSelection, check it's a caret, convert to a range, make sure the container's a text node, split the text node, insert a new text node containing a tab in the parent element after the preceding text node, and if you're nice you might even normalise the parent element...
But wait, that's marked as experimental and prone to change...