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