I am using following codes to fetch the conent of tinymce.
tinymce_content=tinyMCE.get(\'txt_area_id\').getContent();
updated_content=tinymce_content+\"
@Thariama's answer worked fine for me in Chrome, but not in IE. I had to modify it to the following to get it to work in both browsers:
var ed = tinyMCE.get('txt_area_id'); // get editor instance
var newNode = ed.getDoc().createElement ( "img" ); // create img node
newNode.src="sample.jpg"; // add src attribute
ed.execCommand('mceInsertContent', false, newNode.outerHTML)
(IE was telling me that range did not have an insertNode method.)