Saturday, 24 August 2013

execCommand insertHtml, outer div not inserted why?

execCommand insertHtml, outer div not inserted why?

Why is the DIV not inserted but only the IMG ?
$(document).ready(function() {
$(document).on('click', '#insertImage', function(){
/*
Why is the DIV not inserted ?
*/
var item = "<div class='resizable'><img
src='http://www.rockiesventureclub.org/wp-content/uploads/2013/02/flower-icon.png'></div>";
document.execCommand('insertHTML', false,item)
})
});
see: http://jsfiddle.net/daslicht/gU2jP/#base

No comments:

Post a Comment