I have the following markup:
<div class="form-fields">
<div class="row">
<span class="info">Info</span>
</div>
</div>
Using the children selector how can I select span.info? I have tried doing:
$('.form-fields').children('.row .info')
But this didn't work for me.
EDIT: Thanks for the answers everyone. If I assign the container DIV as follows:
var parentDiv = $('.form-fields')
Then using the var 'parentDiv' what is the best way to select span.info?
Use find
to get non-direct descendants:
$('.form-fields').find('.row .info')
Why do you need to use .children
?
$('.form-fields span.info')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With