Selecting the image after execCommand
- by jerebear
Have been banging my head against the wall on this one for a while now.
I have an editor that is inserting an image but I can't get it to select the newly inserted image in Firefox after execCommand Runs. Here's my code.
var editor = this;
var sel = editor._getSelection();
var range = editor._createRange(sel);
editor._doc.execCommand("insertimage", false, imgURL);
img = range.startContainer.previousSibling;
console.log(img);