user132638
user132638

Reputation: 69

Table row length in javascript show one extra

I have a table with an id of myPicks and when I execute the code below, the result is always one more than of the number of rows I have? Is this how it's suppose to behave? Thanks.

var table =document.getElementById("myPicks");
var rowCount = table.rows.length;

Upvotes: 1

Views: 3547

Answers (1)

Travis J
Travis J

Reputation: 82297

Do you have a header? This could account for the extra "row"

Upvotes: 4

Related Questions