title: Highlight the text and count characters
body: <p>This might be a rather silly question. But how do you highlight or select any text or p tag in the body and jQuery will count the selected/highlighted characters?
  Thanks</p>
  
  <p>I've got this, but getting 0</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function(){
  
          $('p').mouseup(function(){
  
          var length = $(this).val().length;
  
          console.log(length);
  
      });
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>P.S. For those who voting down. Why do you do that? Should not we be helping each other?!</p>