If you need a WYSIWYG editor, CKEditor could be the answer. Check out their documentation here.
To properly load CKEditor, make sure to add the following script tag in the header:
<script src="../ckeditor/ckeditor.js"></script>
...
Then, include this textarea tag in the body:
<textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10">
While it should work flawlessly this way, some users have reported issues when using require.js. Take a look at the below main.js file (which acts as the entry point for require.js)
requirejs.config({
baseUrl: 'js',
paths: {
jquery: 'jquery',
ckeditor: 'ckeditor/ckeditor',
domReady: 'domReady'
},
shim: {
ckeditor: {
deps: ['domReady']
}
}
});
require(['ckeditor'], function(ck){
});
Additionally, here is a snippet from the index.html file:
<!DOCTYPE html>
<html manifest="cache.manifest">
<head>
<script data-main="js/main" src="js/require.js"></script>
</head>
<body>
<textarea class="ckeditor" name="editor1"></textarea>
</body>
</html>
If you're stuck and encountering errors, let us know so we can assist in pinpointing where things may have gone wrong. Thanks!