为什么完全按照老师的却alert不出来?但是把alert前两句注释掉就出来了
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("**&&&&&&&&&&&&&&&************************&&&&&&&&&&&&&&&&&&&&&&&&"); }
为什么完全按照老师的却alert不出来?但是把alert前两句注释掉就出来了?哪里错了吗?这里卡了好久了求大神指点啊!!!????????