求救!怎么回事呢??
为什么我alert显示都是undefined?????
function $(id){
return typeof id==='string'?document.getElementById(id):id;
}
window.onload = function(){
//获取鼠标滑过或点击的标签和要切换内容的元素
var titles = $('notice-tit').getElementsByTagName('li');
divs = $('notice-con').getElementsByTagName('div');
alert(titles.lenght);
}