title: jQuery How to hide all span containing td in a table
body: <p>I have some rows in a table like the code below and I want after some seconds to hide the contents of <code>td</code>'s (i have filled them with text in a loop).
  My sample code is this </p>
  
  <pre><code>setTimeout(function() {
    $('span').each(function(index, el) {
        $(this).hide();//nothing happens
    });
  }, 5000);
  
  
  &lt;tr&gt;
    &lt;span class="myspan"&gt;&lt;td&gt;&lt;/td&gt;&lt;/span&gt;
    &lt;span class="myspan"&gt;&lt;td&gt;&lt;/td&gt;&lt;/span&gt;
    &lt;span class="myspan"&gt;&lt;td&gt;&lt;/td&gt;&lt;/span&gt;
    &lt;span class="myspan"&gt;&lt;td&gt;&lt;/td&gt;&lt;/span&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>I tried using other ways too, like saving all <code>span</code>s to an array, or selecting the class and hiding it.</p>
  
  <pre><code>var arr=$('span');
  for (var i=0;i&lt;arr.length;i++){
    arr[i].css('visibility','hidden');
  }
  </code></pre>
  
  <p>but same thing happened. I want to be able to show and hide the contents of <code>td</code>'s when it's needed without hiding the border if it is possible</p>