views:

232

answers:

2

I've been to jquery select class inside parent div and Testing objects for ancestor/descendent relationship in JavaScript or Jquery and jQuery wild card character but can't seem to fit the pieces together. Thanks.

<div id="viewContainerTop" class="top">
  <div class="row1"></div>
  <div class="row2"></div>
  <div class="row2"></div>
  <div class="row2"></div>
  <div class="row3 first"></div>
  <div class="row3"></div>
  <div class="row3"></div>

+1  A: 
$("#viewContainerTop > div:not(.row2)").hide();
devin_s
+1  A: 

Machting the code you posted (parent has id viewContainerTop)

$("#viewContainerTop > div:not(.row2)").hide();

Matching what you wrote (parent has class not id viewContainerTop)

$(".viewContainerTop > div:not(.row2)").hide();
jitter
Thanks jitter. I won't update the text in the title making my mistake permanent and your answer logical. :-)On to the next issue... http://stackoverflow.com/questions/1719211/jquery-to-hide-all-classes-that-start-with-row-except-row2-only-when-the-pare
GollyJer