JSFiddle - React, Tailwind, and code Playground

by PalinDrome555

HTML

<script src="http://tinymce.cachefly.net/4.2/tinymce.min.js"></script>
<form>
    <textarea id='instance1'></textarea>
</form>

<button id='get'>Test</button>

<div id='previewHTML'></div>

<div id='previewFormat'></div>

JavaScript

var textArea_id = "#instance1";

tinymce.init({
   selector: textArea_id,
   toolbar: "underline",
   formats : {
             underline : {inline : 'u', exact : true},
             }
});


var button = document.getElementById('get');

button.onclick = function(){
 var contentHTML = tinymce.activeEditor.getContent({format: 'html'});
 document.getElementById('previewHTML').innerText = contentHTML;
 document.getElementById('previewFormat').innerHTML = contentHTML;
}