Created
September 6, 2016 10:18
-
-
Save ilucin/3ef25981712b81ad7b7cc49c70e14575 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var trix = document.querySelector('trix-editor'); | |
var btn = document.createElement('button'); | |
btn.innerHTML = 'Press me'; | |
btn.addEventListener('click', function() { | |
trix.editor.loadJSON({document: []}); | |
trix.editor.insertHTML(''); | |
}); | |
trix.parentElement.appendChild(btn); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment