Questions tagged [inserthtml]

23 questions
6
votes
2 answers

Chrome execCommand 'insertHTML' inserts span outside of node when caret is inside it

My task is to insert an empty span node within a contentEditable div at current caret position. The following gives me no problems on Firefox 22.0: HTML
5
votes
1 answer

How to place an html element at the cursor position in Ckeditor?

I have such difficulties to succeed in placing an html element I am drag/dropping in my Ckeditor. So far, I have just been able to place it at the very end of my content with "setData". But I want to place it at the position I am in my cursor. I…
user2183282
  • 133
  • 2
  • 7
2
votes
1 answer

execCommand insertHTML breaks stored window.getSelection()

When using methods of selecting text and restoring selected text in a page, I have found that running execCommand('insertHTML... inbetween causes the stored selection to break. This is a sample of how the text is selected and restored. // Get…
Blowsie
  • 40,239
  • 15
  • 88
  • 108
2
votes
8 answers

Getting started with javascript, got a questions

I'm following w3school beginner tutorial for JS. There's something I don't understand from code below: