JQuery: is there a way to make a recursive child selector?

instead of checking only the immediate children of the element, I would like to recursively check all the children of this element.

in particular, something like

$("#survey11Form>input[type=text]:visible").val(); 

with html:

 <form id="survey11Form" name="survey11Form" action="#" method="post"> <div id="survey11Div"> <fieldset> <legend>TEST'TEST"TEST</legend> <div class="label"> <label test="" title="TEST'TEST" for="answer15"> TEST'TEST"TEST </label></div> <div class="fieldWrapper text required"> <div style="width: 146px;" class="cellValue"> <input type="text" title="TEST'TEST" value="" id="survey11answer15" name="survey11answer15"> 

should give me the meaning of this input. The jquery I came across is no. any ideas on what will work in this situation (and in all recursive situations)?

thanks!

+6
jquery jquery-selectors
source share
1 answer

I think you want

 $("#survey11Form input[type=text]:visible") 
+12
source share

All Articles