JavaScript can not only control the output content of the browser, but also control the browser behavior, such as closing the browser, maximizing the browser, controlling the browser scroll bar and browser menu. Codes 1-7 are a paragraphWebsite constructionJavaScript code, which can control the size of the browser.
Use the previous example. Note that line 4 is newly added.After saving, double-click to open the browser window, and the size of the browser window will be automatically adjusted to 500 (pixels) wide and 200 (pixels) high.
The Document object of JavaScript contains the actual content of the page, so the document object can be used to obtain the page content, such as page title, various table units, etc.Code 1-8 is an example of using JavaScript to obtain the page title and form value. Save the above code as "getdoc. htm", open it with a browser, and the running result is shown in Figure 1.19.