title: Greasemonkey script to find rows with certain conditions
body: <p>I tried some different ways do find rows in a table where a columns contain a particular link.</p>
  
  <p>My goal: replace an icon when a link to xyz is in this same row as the image.</p>
  
  <p>This is my snippet so far:</p>
  
  <pre><code>var rows = document.getElementsByTagName("tr");
  for(var i = rows.length - 1; i &gt;= 0; i--) {     
          var links = rows[i].getElementsByTagName("a");
          for(var k = links.length - k; k &gt;= 0; k--) {
              if (links[k].href =="http://www.XXXX.net/forum/index.php?showforum=121"){
                  var images = rows[i].getElementsByTagName("img");
                      for (var j=0;j&lt;images.length;j++) {
                      images[j].src = "http://www.XXXX.net/forum/folder_post_icons/icon7.gif";
                      }
              }
          }
  }
  </code></pre>
  
  <p>I'm pretty sure this is not really the best concept. But as you might see I try to search links in all rows and once the link to forum "121" is found, I try to replace all images in this particular row.</p>
  
  <p>What I get is every image at the site getting replaced. </p>