计算a<;p>;使用JQuery
我有一个计算a<;p>;使用JQuery,jquery,Jquery,我有一个 <p style="display: block;" class="title fieldChoices">Choices: <input value="option1" maxlength="150" id="Choice1"/> <input value="option2" maxlength="150" id="Choice2"/> </p> 选项: 我正在尝试使
<p style="display: block;" class="title fieldChoices">Choices:
<input value="option1" maxlength="150" id="Choice1"/>
<input value="option2" maxlength="150" id="Choice2"/>
</p>
选项:
我正在尝试使用
JQUery。请建议一种方法。这行得通吗,因为p类是“标题字段选择”?这实际上是两个类:标题和字段选择。所以,是的,这会奏效。空间分隔符分隔多个类。
$("p input").length;
$("p.fieldChoices input").length;