dom - jQuery Find Input Text Elements several levels -


first @ reading.

i wrote code suppose search input type text inside many idea search if each element inside of contains text, if it's tr .show() if of elements inside of tr contains text tr .hide(). cant value of input, maybe silly mistake. structure be:

   <tr>     <td><div><div><input type="text" value="hello world" /></div></div><td>     <td><div><input type="text" value="hello world" /></div><td>     </tr>     <tr>     <td><input type="text" value="tutu" /><td>     <td><span><input type="text" value="orl" /></span><td>     </tr>  /* renglones every <tr> */ $.each( renglones, function() {         var inputs = $(this).find('input [type=text]').find('input');         console.info(inputs);         $(inputs).each(function() {             console.info($(this).val());         });     }); 

you can use :text selector

renglones.each(function () {//assuming renglones jquery object     var $inputs = $(this).find('input:text');     $inputs.each(function () {         console.info($(this).val());     }); }); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -