我是最顶级父topIframe



 父级js部分:
 var btn=document.getElementById('btn1');
 btn.onclick=function(){
 var childBody=document.getElementById("topIframe").contentWindow.document.getElementsByTagName('body')[0];
     childBody.style.backgroundColor="#ff0"; 
 }
 子级pIframe1中js部分:
 var btn=document.getElementById('pBtn');
 var btn2=document.getElementById('pBtn2');
 btn.onclick=function(){
	 var parent=window.parent;
	 var tit=parent.document.getElementsByTagName('h4')[0];
	 tit.style.color='#f00';
 }
 btn2.onclick=function(){
	 var parent=window.parent;
	 var topCont=parent.document.getElementById("topIframe2").contentWindow;
	 var body=topCont.document.getElementsByTagName('body')[0];
     body.style.backgroundColor='#f00';
 }