title: Best way to implement .lastChild using Prototype or jQuery
body: <p>Currently we are using prototype and jQuery as our js frameworks. Right now, jQuery is set to $j() to prevent conflicts from prototype.</p>
  
  <p>In the past, we've used a lot of prototype's Element.down(), Element.next(), and Element.previous() to traverse the DOM. However, I need a simple way to retrieve the last child element. I know i can loop through an array by using Element.childElements() but I would like something inline that reads cleanly and can be pipelined.</p>
  
  <p>Just thought I would ask before I go reinventing the wheel. Here's a snippet of code that has lastChild in it that needs to be replaced:</p>
  
  <pre><code>_find : function(rows, address) {
          var obj = null;
          for (var i=0; i &lt; rows.length &amp;&amp; obj == null; i++) {
              if (rows[i].down().className == 'b')
                  obj = this._find(rows[i].lastChild.down().down().childElements(), address);
              else if (rows[i].lastChild.getAttribute('tabAddress') == address)
                  return rows[i].lastChild;
          }
          return obj;
      }
  </code></pre>