If the parent element has a different origin, you cannot do this because access to the parent content is denied. The same source policy .
If the parent document is on the same origin, this should do it:
(function() { var frames = window.parent.document.getElementsByTagName("iframe"), index, frame; for (index = 0; index < frames.length; ++index) { frame = frames[index]; if (frame.contentWindow == window) { frame.frameBorder = "none"; } } })();
Live example | parent source | frame source
Note that when comparing window properties, it is important to use == rather than === (unusual, window is special).
source share