2012-03-30 91 views

回答

17
function insertYourContent(){ 
    tinyMCE.activeEditor.execCommand('mceInsertContent', false, "Whatever text"); 
} 

var myIcon = document.getElementById("sInput_netadvimage"); 
if(myIcon.attachEvent) 
    myIcon.attachEvent("onclick", insertYourContent); 
else if(myIcon.addEventListener) 
    myIcon.addEventListener("click", insertYourContent, false); 
2
function insertYourContent(text){ 
     tinyMCE.execInstanceCommand("elm1","mceInsertContent",false,text); 
}