Javascript in FireFox

document.getElementById("box").height = 100;

呢一句 IE 正常行到, 但 FireFox 就行唔到. 點解嘅?

document.getElementById("box").style.height = '100px';

TOP

另一個可能係ie食 getElementById 係case insensitive.

TOP

唔該兩位.
最後發現係 FireFox 同 <object> tag 嘅問題.

TOP

呢兩句野係有少少分別架
document.getElementById("box").height = 100;
document.getElementById("box").style.height = '100px';

假設box係<img>,佢地既分別係

document.getElementById("box").height = 100;
係改呢個
<img id="box" height=100>

document.getElementById("box").style.height = '100px';
係改呢個
<img id="box" style="height:100px">

TOP