javascript - Enable resize for div inside contenteditable div -
i have div contenteditable set true. want enable resize div inside contenteditable div.
in example html insert works fine how make inserted html div resizable?
code:
function inserthtml() { var sel = document.selection; if (sel) { var textrange = sel.createrange(); document.execcommand('inserthtml', false, "<div><img src='https://www.google.com/images/srpr/logo11w.png' height='42' width='42'></div>"); textrange.collapse(false); textrange.select(); } else { document.execcommand('inserthtml', false, "<div><img src='https://www.google.com/images/srpr/logo11w.png' height='42' width='42'></div>"); } }
fiddle: http://jsfiddle.net/q6q05f1b/
Comments
Post a Comment