Javascript Presentation 2 (Page 4)

Page HTML: The Select box

Previous Cancel Demonstration Next
<span id="DisplayType">Not Drawn</span>
(Trying
<select id="Select" onchange="selectType(this)">
<option value="Canvas">Canvas
<option value="Server">Server
</select>
)

This section of the HTML contains two parts. The first is the span area which is used to display the source of the image. It is a span element, which will have its contents changed by the CGI program once the source of the image is determined.

Although it starts out with the "not drawn" value, this is only displayed if the Javascript program is not run, such as if Javascript is not enabled.

The second part is the drop down box which allows the user to select whether or not the canvas element is used. This is primarily for debug purposes. If the browser does not support the canvas element, then the setting of this select box doesn't make any difference.

Note that the select box is a request by the user to either use the canvas, or to not use the canvas. The display area is a statement of what the browser actually did. Therefore, it is possible to have the select box say, "canvas" but the display area say "server." It is not possible for the select box to say "server" and the display to say "canvas."