window.onload =function(){ var a =1; var oBtn = document.getElementById('btn');
oBtn.onclick = function(){
foo();
}
}
function foo(){ console.log(a) //Uncaught ReferenceError: a is not defined
}
添加回答
举报
0/150
提交
取消
