JSFiddle - React, Tailwind, and code Playground
by deathstalkersid
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form>
<div id="editor">Old Content.</div>
<button type="submit" id="submit">Submit</button>
</form>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/31.0.0/classic/ckeditor.js"></script>
<script>
let watchdog;
ClassicEditor
.create(document.querySelector('#editor'))
.then(editor => {
watchdog = editor;
})
.catch(error => {
console.error(error);
});
$('#submit').on('click', function(event) {
event.preventDefault();
console.log(watchdog.getData());
});
</script>
</body>
</html>