title: Is it possible to keep adding methods inside an iteration?
body: <p>I would like to keep adding a method such as <code>.next()</code> everytime it does not find a specific value. Is this possible in javascript?</p>
  
  <p>Example:</p>
  
  <p>right now this is what I have:</p>
  
  <pre><code>    $('.contenido').filter(function(){
          var data = $(this);
          var tableLength = data.children().children('tr').length;
          var table = data.children().children().children();
          var row = table.next().next().next().next().children();
          link = row.attr('href');
  
      })
  </code></pre>
  
  <p>link returns the href of <code>row</code>. But lets say there are more rows with the href attr. How can I loop to keep adding <code>.next()</code> to <code>row</code> until it finds one with the href attr?</p>