title: Html and Internet Explorer: How to avoid hidden elements to be copied/pasted
body: <p>I've a TABLE, in a HTML5 document.</p>
  
  <p>I've a view selector who hide/show some rows, using jQuery <code>hide()</code> and <code>show()</code>.</p>
  
  <p>When user select the table (programmatically, using a 'select all' button, see below for the code), and then copy/paste into, for example, Word or Outlook email, the behaviour is different from FF and IE.</p>
  
  <ul>
  <li>FF: doesn't copy elements with <code>style='display: none;'</code>. It's desired and expected behaviour</li>
  <li>IE: copy ALL, and paste ALL, so my visual 'trick' is then useless for IE users.</li>
  </ul>
  
  <p>I add my <code>selectAll</code> function. Simply expect a selector and select all the text inside it. It's something I copy/pasted from the jQuery forum.</p>
  
  <pre><code>jQuery.fn.selectText = function(){
      var doc = document;
      var element = this[0];
      // console.log(this, element);
      if (typeof element == 'undefined') {
          return;
      }
      if (doc.body.createTextRange) {
          var range = document.body.createTextRange();
          range.moveToElementText(element);
          range.select();
      } else if (window.getSelection) {
          var selection = window.getSelection();        
          var range = document.createRange();
          range.selectNodeContents(element);
          selection.removeAllRanges();
          selection.addRange(range);
      }
  };
  </code></pre>
  
  <p><strong>How can I select only visible elements ? Or... is there any other html/js trick?</strong></p>
  
  <p>BTW <em>I'll downvote whoever will propose to</em>:</p>
  
  <ul>
  <li><p>change users</p></li>
  <li><p>force users to change browser</p></li>
  <li><p>ask me to render only visible cells and change server code</p></li>
  </ul>