The second, optional argument to the open() method discussed earlier is a name for the newly created window. By giving a top-level browser window a name, we've seen that you can look up a reference to that window by calling the open() method again. But you can also refer to a window by name in another way: by specifying the window name as the value of the TARGET attribute of the <A>, <MAP>, and <FORM> tags. What this does is tell the browser where you want the results of activating a link, clicking on an image map, or submitting a form to be displayed. For example, if you have two windows, one named "table_of_contents" and the other named "mainwin", then you might have HTML like the following in the "table_of_contents" window:
<A HREF="chapter01.html" TARGET="mainwin"> Chapter 1, Introduction </A>
 This argument is not optional in Internet Explorer 3.0.
Since frames are a type of window, frames can also have names that can be used with the TARGET attribute. You specify a name for a frame with the NAME attribute of the <FRAME> tag that creates the frame.
There is even another reason to give names to frames. We've seen that every Window object has a frames array that contains references to each of its frames. This array contains all frames in a window (or frame) whether or not they have names. But if a frame is given a name, then a reference to that frame is also stored in a new property of the parent Window object. The name of that new property is the same as the name of the frame. Therefore, if you create a frame with HTML like this:
<FRAME NAME="table_of_contents" SRC="toc.html">