Abhishek Singh
Abhishek Singh

Reputation: 425

Hide File Edit Insert from TinyMCE Editor

I just want to remove File Edit Insert View options from the menu in TinyMCE Editor.enter image description here

I try using inspect element and using below javascript code to delete the menu row:

document.getElementById('tinymce-16').style.display = 'none';

but it doesnt work. I get error

Uncaught TypeError: Cannot read property 'style' of null

Upvotes: 0

Views: 1091

Answers (1)

PalinDrome555
PalinDrome555

Reputation: 927

It is actually quite simple. You need to specify what you want displayed on initialization of the editor.

HTML

<form>
    <textarea></textarea>
</form>

JS

tinymce.init({
    selector: 'textarea',
    plugins: [
        "code table"
    ],
    menubar: "format table tools",
});

This will only display format, table and tools. See this DEMO

Upvotes: 1

Related Questions