Function with no arguments

This example uses two programmer-defined functions called regular and large. The functions are defined in the head section of the page. Neither function has an argument -- they are self contained. (The comment is designed to hide the function definition from early Web clients that did not recognize Javascript).

The onClick event handlers in the page body call the two functions.

 

Open a window of 640 x 480 pixels:

Open a window of 800 x 600 pixels:


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.