How to add text in tinyMce in the position of the cursor, when one of the icons will be clicked? The icon has id = sInput_netadvimage.
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);
function insertYourContent(text){
tinyMCE.execInstanceCommand("elm1","mceInsertContent",false,text);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With