Skip to content

Instantly share code, notes, and snippets.

@seanpierce
Created December 12, 2017 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanpierce/336fdb5a2db8dc3b2831f50a4a8b5d2d to your computer and use it in GitHub Desktop.
Save seanpierce/336fdb5a2db8dc3b2831f50a4a8b5d2d to your computer and use it in GitHub Desktop.
<!-- 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>
@seanpierce
Copy link
Author

Super simple and easy RTE from Quill. Docs here:
https://quilljs.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment