<!doctype html>
<html>
<head>
<title>My test</title>
<link rel="stylesheet" type="text/css" href="editor/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<div contenteditable="true" class="doc">
<p contenteditable="true" class="letters" >My editor</p>
</div>
<button id="but">Done Editing</button>
<script>
$(document).ready(function()
{
$('#but').on('click',function(){
//want to obtain all the text within the contenteditable div on clicking the button
});
});
</script>
</body>
</html>
On clicking the "Done Editing" button I want to get all the text which is entered in my contenteditable div. Apparently,commands such as
var content = $('.doc').text();