javascript to click a row and fire off that rows "onclick" event
<p>I have a table:</p>

<pre><code>&lt;table&gt;
&lt;th&gt;Title&lt;/th&gt;
&lt;th&gt;Artist&lt;/th&gt;
&lt;th&gt;Length&lt;/th&gt;
&lt;tbody&gt;
&lt;?php
foreach ($lib as $name)
{
echo "&lt;tr onmouseover=\"ChangeColor(this, true);\" 
              onmouseout=\"ChangeColor(this, false);\" 
              onclick=\"dispSong('".$name-&gt;title. "','".$name-&gt;url."', this);\"&gt;&lt;td&gt;".$name-&gt;title."&lt;/td&gt;&lt;td&gt;".$name-&gt;artist."&lt;/td&gt;&lt;td&gt;".$name-&gt;time."&lt;/td&gt;&lt;/tr&gt;";
}
?&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>In javascript I can find the next row:</p>

<pre><code>    function dispSong(theSong, url, elem)
  {

    document.getElementById('currSong').innerHTML = theSong;
    row = elem.rowIndex; 
    var song = document.getElementById('mp3');
    song.src = url;
    song.load();
  }

  function nextSong()
  {
    if (row == null) row = 1;
    else{
    alert(row+1);
    }
    document.getElementById('tr')[row].click;
    var song = document.getElementById('mp3');
    alert(song);
    song.src = url;
    song.load();
  }
</code></pre>

<p>I have a button called next that calls the nextSong function when it is clicked. I am wondering if I can some how programatically click the next row when the next button is pressed.</p>
