Firefox [removed] Why does .all not work?

前端 未结 2 1703
闹比i
闹比i 2020-12-20 01:17

In IE, I can go like:

var x = document.getElementById(\"header\");

alert(x.all[0].tagName);

If I try that in Firefox, I get the error \"al

2条回答
  •  悲&欢浪女
    2020-12-20 01:55

    all would be the name of an array. It is not a native javascript keyword.

    You may want to look at childNodes instead.

提交回复
热议问题