Created
December 12, 2017 21:21
-
-
Save seanpierce/336fdb5a2db8dc3b2831f50a4a8b5d2d to your computer and use it in GitHub Desktop.
This file contains 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
<!-- Include stylesheet --> | |
<link href="https://cdn.quilljs.com/1.3.4/quill.snow.css" rel="stylesheet"> | |
<!-- Create the editor container --> | |
<div id="editor"> | |
<p>Hello World!</p> | |
<p>Some initial <strong>bold</strong> text</p> | |
<p><br></p> | |
</div> | |
<button onclick="submitInfo()">Submit</button> | |
<div id="result"></div> | |
<!-- Include the Quill library --> | |
<script src="https://cdn.quilljs.com/1.3.4/quill.js"></script> | |
<!-- Initialize Quill editor --> | |
<script> | |
var quill = new Quill('#editor', { | |
theme: 'snow' | |
}); | |
function submitInfo() { | |
let content = document.getElementById('editor'); | |
let value = content.getElementsByClassName('ql-editor')[0].innerHTML; | |
document.getElementById('result').innerHTML = value; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Super simple and easy RTE from Quill. Docs here:
https://quilljs.com/