title: Hiding Unselected Table TR TD content with jQuery
body: <p>I am trying to hide parts of a table content, but having trouble hiding the label of the unselected selects.</p>
  <p>I have the following three choices.  If I user Selects one of them, I would like to hide the Other two and only display the Label and Selected choice.  Right now, I am able to hide everything else except the Label.</p>
  <p>I tried to add a <code>$(this).closest(&quot;tr td .text-prompt&quot;).show();</code><br />
  and a <code>$(&quot;tr td .text-prompt&quot;).not($(this)).hide();</code></p>
  <p>but that did not work to hide the unselected group.  Please help figuring this out...</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function () {
      $("select").each(function () {
          $(this).on("change", function () {
              var val = $(this).val();
              //alert(val);
              console.log(val);
              if (val &gt; 0) {
                  $('.add-to-cart').show();
                  $('#selectPhoto').hide();
                  $('.attribute-description').hide();
                  $("select").hide();                                       
                  $(this).show();
  
              } else {
                  $("select").show();
                  $('#selectPhoto').show();
                  $('.attribute-description').show();
                  $('.add-to-cart').hide();
                  // $(this).hide();
              }
          });
      });
  });
  &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td id=product_attribute_label_390&gt;
              &lt;label class=text-prompt&gt;CANVAS PRINTS &lt;/label&gt;
              &lt;div class=attribute-description&gt;
                  &lt;p&gt;Please Choose your Size:
              &lt;/div&gt;
          &lt;/td&gt;
  
          &lt;td id=product_attribute_input_390&gt;
              &lt;select name=product_attribute_390 id=product_attribute_390&gt;
                  &lt;option value=0&gt;---
                  &lt;option value=2391&gt;8 &amp;quot;X 12 &amp;quot;[&amp;#x2B;$26.00]
                  &lt;option value=2392&gt;10 &amp;quot;X 12 &amp;quot;[&amp;#x2B;$28.00]
                  &lt;option value=2393&gt;16 &amp;quot;X 20 &amp;quot;[&amp;#x2B;$35.00]
                  &lt;option value=2394&gt;20 &amp;quot;X 24 &amp;quot;[&amp;#x2B;$60.00]
                  &lt;option value=2395&gt;24 &amp;quot;X 36 &amp;quot;[&amp;#x2B;$50.00]
                  &lt;option value=2396&gt;30 &amp;quot;X 40 &amp;quot;[&amp;#x2B;$66.00]
                  &lt;option value=2397&gt;36 &amp;quot;X 48 &amp;quot;[&amp;#x2B;$142.00]
                  &lt;option value=2398&gt;40 &amp;quot;X 60 &amp;quot;[&amp;#x2B;$200.00]
              &lt;/select&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td id=product_attribute_label_386&gt;
              &lt;label class=text-prompt&gt;ACRYLIC PRINTS &lt;/label&gt;
              &lt;div class=attribute-description&gt;
                  &lt;p&gt;Please Choose your Size:
              &lt;/div&gt;
          &lt;/td&gt;
          &lt;td id=product_attribute_input_386&gt;
              &lt;select name=product_attribute_386 id=product_attribute_386&gt;
                  &lt;option value=0&gt;---
                  &lt;option value=2361&gt;8 &amp;quot;x 12 &amp;quot;[&amp;#x2B;$70.00]
                  &lt;option value=2362&gt;12 &amp;quot;X 16 &amp;quot;[&amp;#x2B;$80.00]
                  &lt;option value=2363&gt;12 &amp;quot;X 36 &amp;quot;[&amp;#x2B;$160.00]
                  &lt;option value=2364&gt;16 &amp;quot;x 20 &amp;quot;[&amp;#x2B;$110.00]
                  &lt;option value=2365&gt;20 &amp;quot;x 24 &amp;quot;[&amp;#x2B;$208.00]
                  &lt;option value=2366&gt;20 &amp;quot;x 30 &amp;quot;[&amp;#x2B;$220.00]
                  &lt;option value=2367&gt;30 &amp;quot;x 40 &amp;quot;[&amp;#x2B;$280.00]
              &lt;/select&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td id=product_attribute_label_387&gt;
              &lt;label class=text-prompt&gt;METAL PRINTS &lt;/label&gt;
              &lt;div class=attribute-description&gt;
                  &lt;p&gt;Please Choose your Size:
              &lt;/div&gt;
          &lt;/td&gt;
          &lt;td id=product_attribute_input_387&gt;
              &lt;select name=product_attribute_387 id=product_attribute_387&gt;
                  &lt;option value=0&gt;---
                  &lt;option value=2368&gt;8 &amp;quot;x 12 &amp;quot;[&amp;#x2B;$60.00]
                  &lt;option value=2369&gt;12 &amp;quot;x 16 &amp;quot;[&amp;#x2B;$70.00]
                  &lt;option value=2370&gt;12 &amp;quot;x 36 &amp;quot;[&amp;#x2B;$252.00]
                  &lt;option value=2371&gt;16 &amp;quot;x 20 &amp;quot;[&amp;#x2B;$80.00]
                  &lt;option value=2372&gt;20 &amp;quot;x 24 &amp;quot;[&amp;#x2B;$160.00]
                  &lt;option value=2373&gt;20 &amp;quot;x 30 &amp;quot;[&amp;#x2B;$220.00]
                  &lt;option value=2374&gt;30 &amp;quot;x 40 &amp;quot;[&amp;#x2B;$356.00]
              &lt;/select&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>