0

Possible Duplicate:
IE only javascript error with getElementsByTagName

var rows=myTable.getElementsByTagName('tr');   
rows=Array.prototype.slice.call(rows,0);

Does not work in IE, is there any other way, to convert this into a real array, so that I could use a sort function over it...?

Community
  • 1
  • 1
geekman
  • 2,224
  • 13
  • 17

1 Answers1

5

You need to use a loop if IE version < 8.

var rows=myTable.getElementsByTagName('tr');   
var row_array = [];
for (var i = 0; i < rows.length; i++) {
  row_array.push(rows[i]);
}
xdazz
  • 158,678
  • 38
  • 247
  • 274