I though this would be simple enough but I can't find the answer. I need to know how I can access an iframe's name from within said iframe. I was trying something like this but it's not working.
<iframe name="thename"> <script type="text/javascript"> alert(parent.name); </script> </iframe>
There is a combination of answers I prefer:
// window.frameElement Gets IFrame element which document inside window.frameElement.getAttribute("Name");
It works on IE7+, Mozilla & Chrome
1.4m articles
1.4m replys
5 comments
57.0k users