Example 07 - Toggle editor with JavaScript


Configuration that goes into the script tag.

tinyMCE.init({
	mode : "textareas",
	theme : "advanced"
});

function toggleEditor(id) {
	if (!tinyMCE.getInstanceById(id))
		tinyMCE.execCommand('mceAddControl', false, id);
	else
		tinyMCE.execCommand('mceRemoveControl', false, id);
}

And the result. View the source of this page to see how the HTML looks.


Add/Remove editor

Test