I'm trying to highlight an image when it's clicked in a contenteditable iframe. I've tried this but nothing happens:
var iframeDoc = editor.contentDocument || editor.contentWindow.document;
var range = rangy.createRange(iframeDoc);
var sel = rangy.getIframeSelection(editor);
range.setStartBefore(img);
range.setEndAfter(img);
sel.setSingleRange(range);
Is there something I'm missing, or is this not possible? I'm using chrome but want to target as many browsers as possible.