title: check if selection contains div Jquery
body: <pre><code>t = window.getSelection();
  
  if ((t) contains (div.class)){
   //do something
  }
  </code></pre>
  
  <p>How can I do that WHILE selecting the text? Not after the text is selected(eg: after I release the click). I plan to remove selection (document.getSelection().removeAllRanges(); ) if I find a div with a specific class.</p>
  
  <p>Thanks!</p>
  
  <p>I already have a mouseup function. if that is what I need, I can add new code to that...</p>