bpbhat77
bpbhat77

Reputation: 529

Select class and then select input in 3rd object in the list of classes in jquery

I have my HTML as this

<div class="content">

    <section class="abc">
    <input type="text"/>
    <input type="text"/>
        ...
    <input type="text"/>

    </section>
    <section class="abc">...</section>
    <section class="abc">...</section>
    <section class="abc">...</section>
    <section class="abc">...</section>
    <section class="abc">...</section>

</div>

From the above code i need to select each section by number (like 0th ,1st) all inputs which is having null values

How to write jquery select for this ?

Upvotes: 4

Views: 128

Answers (1)

Rajaprabhu Aravindasamy
Rajaprabhu Aravindasamy

Reputation: 67207

Try,

$('.content .abc:nth-child(1) input:visible').filter(function(){ return $.trim(this.value) === ''; });

I just gave 2n for a demonstration purpose, since your question was unclear, But you can frame that according to your need.

Upvotes: 2

Related Questions