js写面对对象 内部对象不能使用getElementById?
<div id="div1">
<div id="div2"></div>
</div>
<script>
new a();
function a(){
this.d1=document.getElementById('div1');
this.d2=this.d1.getElementById('div2');//Uncaught TypeError: Object #<HTMLDivElement> has no method 'getElementById'
alert(this.d2);
}
</script>
请问为什么
?
谢谢