Accessing parent window elements from iframe

iframe, javascript

Solution

window.parent.document.getElementById('target'); 

both resources should be on same origin

Problem

- I have a `customer.jsp` page with an `iframe`. - `iframe` has a button. on click of the button, i need to access a dialog box which is inside `customer.jsp` page. - I tried `window.parent.document.getElementById('formDialog');` but am getting `null` value.

Original source