I have an asp.net web app that is using an iFrame (called “fraContent”) within the aspx page. In the iFrame, I have a hidden field (called “hdnCounter”) that stores a “counter” value.
From the parent aspx page, how can I access that hidden value from the iFrame?
alert(document.getElementById('window.fraContent.hdnCounter').value); does not seem to work
The ID of the element is not
window.fraContent.hdnCounter, sogetElementByIdwill not work.You simply want:
alert(window.fraContent.document.getElementById('hdnCounter').value)