I want to create a simple WYSIWYG editor with contenteditable and a bold option. This used to be really easy to achieve using execCommand as can be seen here.
Unfortunately execCommand is now deprecated.
My approach to achieve this without execCommand would be the following:
node.innerHTML = '<b>' + node.innerHTML + '</b>')However, I am not sure how to achieve the second part. window.getSelection().anchorNode returns the correct node, but it won't let me set innerHTML or innerText on it.
Is this even possible? Thanks in advance!