insertHTML(html) does not work
I am using this function in order to add a span inside a HTML. However it seems that it is not working. I have used your example and still nothing is being added. The weird thing is that when I am trying the second time in the application, the HTML is being inserted. I used the setHTML function in order to check whether my HTML can be rendered and the HTML is being set successfully. I am using Swift 3, how can I insert a block of HTML?
Thanks in advance.
you can check this return value var result = document.execCommand('insertHTML', false, html); if the result is false, then you should find that whether the selection(by document.getSelection(); ) is in the right state.