title: How can I count the number of elements that match my CSS selector?
body: <p>I am trying to use SeleniumRC to test my GWT App and am trying to match elements using CSS selectors.</p>
  
  <p>I want to count the number of enabled buttons in the following HTML.</p>
  
  <p>A button is enabled if it is under a <code>&lt;td&gt;</code> with <code>class="x-panel-btn-td "</code> and disabled if it is under a <code>&lt;td&gt;</code> with <code>class="x-panel-btn-td x-hide-offsets"</code>.</p>
  
  <p>So basically, I want to retrieve the number of buttons under all <code>&lt;td&gt;</code>s with the class <code>x-panel-btn-td</code>.</p>
  
  <pre><code>&lt;table cellspacing="0"&gt;
      &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td id="ext-gen3504" class="x-panel-btn-td "&gt;
              &lt;em unselectable="on"&gt;
                  &lt;button id="ext-gen3506" class="x-btn-text" type="button"&gt;OK&lt;/button&gt;
              &lt;/em&gt;
          &lt;/td&gt;
          &lt;td id="ext-gen3512" class="x-panel-btn-td x-hide-offsets"&gt;
              &lt;em unselectable="on"&gt;
                  &lt;button id="ext-gen3506" class="x-btn-text" type="button"&gt;Yes&lt;/button&gt;
              &lt;/em&gt;
          &lt;/td&gt;
          &lt;td id="ext-gen3520" class="x-panel-btn-td"&gt;
              &lt;em unselectable="on"&gt;
                  &lt;button id="ext-gen3506" class="x-btn-text" type="button"&gt;No&lt;/button&gt;
              &lt;/em&gt;
          &lt;/td&gt;
          &lt;td id="ext-gen3528" class="x-panel-btn-td x-hide-offsets"&gt;
              &lt;em unselectable="on"&gt;
                  &lt;button id="ext-gen3506" class="x-btn-text" type="button"&gt;Cancel&lt;/button&gt;
              &lt;/em&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>