Hello there,
i’m trying to make a whole [color=blue]<tr>
[code]
function trlink(){
var tr = document.getElementsByTagName(“tr”);
for(var i=0; i < tr.length; i++) {
tr[i].onclick = function() {
location.href=’./?cat=’+(tr[i].getAttribute(‘id’));
}
}
}
The problem with the code is that tr[i].getAttribute doesnt seem to work. Apparently getElementsByTagName is a DOM function and returns a NodeList so i tried various things such as [color=blue]tr.item(i).attributes.item(2).nodeValue;[color=blue]<tr>[color=blue]id[color=blue]id
Can anyone help me here?
Also as a secondary matter, i’d like the row to appear as a link so what is the code for changing the mouse to the link hand and back? Also how do you change the status bar text to the url (for browsers which support it).
This is the code that i tried but it didn’t seem to work (presumably for the same reason as above).
[code]
tr[i].onmouseover = function() {
tr[i].style.cursor=”hand”;
}
tr[i].onmouseout = function() {
tr[i].style.cursor=”pointer”;
}
Thanks ?