The window property parent is a reference to the window that defined the frameset. Use the parent reference when you need to access functions, variables, or elements in another frame. For example:
parent.frames[0].document.form[0].theTextArea.value = "New Text";
If you have several frames that are nested inside each other, you can use the parent of the parent property:
parent.parent.frames[0];
The window property top, on the other hand, always refers to the window object that contains the frame. Scripts contained in frames can access variables and functions loaded in the topmost position of the window by referencing the top attribute.