Update:
New Code:
Code:
function startup(){
StartFlashing();
}
function StartFlashing(){
var rowArray=document.getElementsByTagName('tr');
for (i=0;i<rowArray.length;i++)
{
if (rowArray[i].getAttribute('flash')=='true')
{
changeColour(rowArray[i]);
}
}
}
function changeColour(element) {
var interval = 1000;
var colour1 = "#ff0000";
var colour2 = "#000000";
if (document.getElementById) {
element.style.color = (element.style.color == colour1) ? colour2 : colour1;
setTimeout("changeColour('" + element + "')", interval);
}
}
As I was having trouble passing my elementid in, instead I thought i'd pass the element.
Now the text will begin to flash (by turning red) but on the turn to colour2, it throws the following error: Style is null or not an object. Any clues?