javascriptjquerytinymcetinymce-5tinymce-6

Tinymce editor change border color


How to change the color of the tinymce editor outer border by pressing a button?

enter image description here


Solution

  • Depends on how your Tinymce editor is added to your page, if like here then you can simply:

    <button id="change">Change</button>
    
    document.getElementById('change').addEventListener('click', function() {
       tinymce.get('tinymce_textarea')['editorContainer'].style.borderColor = 'red';
    });
    

    Where tinymce_textarea is id of your textarea