Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Working with Linked Windows 561

20


Output ▼


Next, create a fourth document called green.html, which looks like the following:


<!DOCTYPE html>




Green Page


Green Page


This is the third target page. Its target is yellow_page. It should
replace the yellow page in the browser.




To complete the exercise, load parent.html (the red page) into your web browser. Click
the first hyperlink to open the yellow page in a second browser window. This happens
because the first hyperlink contains the attribute target="yellow_page", as the following
code from parent.html demonstrates:


Open the Yellow Page in a new
window.


Now return to the red page and click the second link. The blue page opens in a third
browser window. Note that the new windows won’t be laid out like the ones shown
in Figure 20.1; modern browsers open new windows as new tabs. The following
target="blue_page" statement in the parent.html page is what causes the new window
to open:


Open the Blue Page in a new window.



FIGURE 20.4
blue.html
displayed in the
web browser
window named
blue_window.



Free download pdf