bit of javascript help

Associate
Joined
18 Sep 2003
Posts
904
Hi,

I suck at javscript, so was wondering if someone could assist with the following:

PHP:
function show_all_rows() {

var mytable= document.getElementById('result_table');
var mychild = mytable.firstChild;

while(mychild!=null)
{  mychild.style.display = 'table-row';
    var mychild = mychild.nextSibling;
    alert ("a");
}
}

I don't know if I am remotely going about the right way of doing this, but basically I have a table with certain rows that are hidden with a display: none, and I want this function to un-hide them. The rows that are hidden are no sequential so I can't just put a span around them.

Thanks
 
Thanks for the advice. I have installed the jQuery library and pasted in the code you posted, as follows:

<input type="checkbox" onClick="$('#result_table tr:display').toggle();" />

However, its not working, and Firefox is actually complaining about the jQuery script (line 26, fn is not defined). Any ideas?
 
Back
Top Bottom