求救!怎么回事呢??
為什么我alert顯示都是undefined?????
function $(id){
return typeof id==='string'?document.getElementById(id):id;
}
window.onload = function(){
//獲取鼠標(biāo)滑過(guò)或點(diǎn)擊的標(biāo)簽和要切換內(nèi)容的元素
var titles = $('notice-tit').getElementsByTagName('li');
divs = $('notice-con').getElementsByTagName('div');
alert(titles.lenght);
}
2015-03-30
function $(id) {
// body...
return ?typeof ?id==='string'?document.getElementById(id):id;
}
window.onload =function(){
? ? ? ? ? ? ?var ?titles=$('ontice-tit').getElementsByTagName('li');
? ? ? ? ? ? ?var divs=$('ontice-con').getElementsByTagName('div');
? ? ? ? ? ?
? ? ? ? ? ? ? alert(titles.length);
? ? ? ? ? ? ? ? ? ? ? }
2015-02-13
你單詞寫錯(cuò)了
2015-02-13
alert(titles.length);