If use following way to get the contentWindow, the value is undefined
iframe test <
window.frames["frame1"];
is the contentWindow, it get's a named window, and in your case it's the same thing as
contentWindow
document.getElementById("frame1").contentWindow
FIDDLE