title: How to Disable Editing in Summernotes?
body: <p>I am using <a href="http://summernote.org/" rel="noreferrer">summernotes</a> component and what I want to do is I want to stop the user from adding characters if s(he) exceeds 2000 Chars but I couldn't figure out how to stop typing event.</p>
  <p>What I am doing is like the following:</p>
  <pre><code> $(&quot;.note-editable&quot;).each(function(){
             $(this).on(&quot;keyup&quot;, function(){
                  var cc = $(this).text().length;
                  var arr = $(this).next().attr(&quot;class&quot;).split('_');
                  var q = &quot;q&quot;+arr[0];
                  var maxChar = arr[2];
                  var textarea = $('*[name^=&quot;'+q+'&quot;]');
                  var diffChar = parseInt(maxChar - cc);
                 
                  if(diffChar &gt;= 0)
                  {
                      $(this).next().text(diffChar + &quot; Remaining out of &quot; + maxChar);
                  }
                  else
                  {
                      $(this).next().text(&quot;0 Remaining out of &quot; + maxChar);
                      
                      //$(textarea).prop('disabled', true);
                      $(this).text($(this).text().slice(0,diffChar));
                  }
             });
          });
  </code></pre>
  <p>Any Idea how to do that, I don't want to disable the cursor or destroy the summernote .. I want to let the user feel that (s)he can still edit but it won't type anything if the text exceeds 2000 chars.</p>
  <p>Thanks!!</p>