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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -