tags:

views:

63

answers:

2

I have a

      <p style="display: block;" class="title fieldChoices">Choices:
          <input value="option1" maxlength="150" id="Choice1"/>
          <input value="option2" maxlength="150" id="Choice2"/>
      </p>

I am trying to count how many input boxes there are in this fieldChoices using JQUery. Please suggest a way how to do so.

+4  A: 
$("p input").length;
peirix
+7  A: 
$("p.fieldChoices input").length;
cletus
will this work since the class op the p is "title fieldChoices"?
Natrium
That's actually two classes: title and fieldChoices. So yes this will work. The space separator delimits multiple classes.
cletus