You can reference the parent either by using parent or using the top variable that always points to the outer most document.
- parent == parent window
- top == out most window
So for accesing the first div in the parent window
var d = parent.document.getElementsByTagName("div")[0];
But as noted already in the comment, both the outer document and the document in the iframe need to be from the same domain or you will be blocked for security reasons.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…