Webskater
04-19-2005, 03:53 AM
I read up on the DOM and rowIndex gets a mention. But:
function changeit(fred,jim,jack,event)
{
if (document.all)
{
alert(fred + ',' + jim + ',' + jack);
event.srcElement.className = "norm"; //just to prove the event element has been detected okay (it has)
var rowNo = event.srcElement.parentElement.rowIndex;
alert(rowNo)
}
else
{
alert(fred + ',' + jim + ',' + jack);
event.target.className = "norm"; //just to prove the event element has been detected okay (it has)
var rowNo = event.target.parentElement.rowIndex;
alert(rowNo)
}
}
In IE the row number is displayed.
In Firefox - nothing - not even an empty alert box.
Any idea how I can find out which row number of a table the element which fires an event is in in Firefox?
Thanks for any help.
function changeit(fred,jim,jack,event)
{
if (document.all)
{
alert(fred + ',' + jim + ',' + jack);
event.srcElement.className = "norm"; //just to prove the event element has been detected okay (it has)
var rowNo = event.srcElement.parentElement.rowIndex;
alert(rowNo)
}
else
{
alert(fred + ',' + jim + ',' + jack);
event.target.className = "norm"; //just to prove the event element has been detected okay (it has)
var rowNo = event.target.parentElement.rowIndex;
alert(rowNo)
}
}
In IE the row number is displayed.
In Firefox - nothing - not even an empty alert box.
Any idea how I can find out which row number of a table the element which fires an event is in in Firefox?
Thanks for any help.