I want to check if there is a child with a specific title under my parent., I've managed to check if children exists, but I want to add a check if the title equals the string "No"..
$(this).find('#test').children().size() === 0;
How can this be done?
Try this: $('[title="No"]', this);
To explain, this will look for an element with title="No" inside this, which will be your current element in a loop, or can be another selector altogether.
Use the attribute equals selector
$(this).find('#test').children('[title=No]').length > 0;
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