tags:

views:

23

answers:

1

I want to create a node such as paragraph, h1, h2 etc inside a tiny mce editor. Could not find any reference in documentation. :( I have tried following code. It works perfect in FF but not in IE. Kindly help.

tinyMCE.activeEditor.selection.setNode(tinyMCE.activeEditor.dom.create('p', {id : 'paraId'},'new paragrapg created'));

Thanks

A: 

You should create the new element on the iframes document. Also, try to use different html tags to check if tiny has a problem inserting p-tags.

with(document.getElementById("iframe_id").contentWindow){
    var new_elem=document.createElement("span");
    new_elem.id='paraId';
    tinyMCE.activeEditor.selection.setNode(new_elem);
}
Thariama