On 6/21/07, Dan Dorman <[EMAIL PROTECTED]> wrote:
function alternateRows(tableID,numberOfColors,colorArray){
  [snipped]
  if (table) {
    var trs=document.getElementById(tableID).getElementsByTagName("TD");
    [snipped]
    }
  }
}

Whoops!  I got a little careless.  The line starting with "var
trs...", while it will still work, is needlessly verbose, since you've
already got the results of getElementById. You can rewrite that line
as:

var trs = table.getElementsByTagName("TD")

to save a few processor cycles and a few keystrokes.

Dan Dorman


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to