CS 203 - Javascript Lab 1

Due within 5 days of lab period

For your first Javascript experience, write a new html page. Since Javascript is executed by the client, there is no need to transfer this page to Osiris. In fact, what I ask you to do might make the page extremely annoying to your visitors! Send it with the form below.

Please try at least the following:

  1. Javascript objects have both methods (functions) and properties (data). Your page is the document object. Use its write() method to write its lastModified property. (This is handy to show how up-to-date your html page is.)
  2. A new Date() object can be created. Write your birthday or other significant event. You'll find out what day of the week it is. You have to use new and assign it to a variable. Examples:
  3. Change the style of some page element, using on-event in some tag, for example (look at the header of this page)
     onmouseover="this.style.color='red'"
  4. Use one of the popups: alert(), confirm() or prompt() and write corresponding content in your page. For example:
  5. (Science Students) Do a second one of these popups.
  6. (Computer Science students) Show a sentence in one of at least 2 languages, depending upon what is clicked (link, button, or radio button).  This can be shown in an input of type text, or more elegantly in a paragraph or other named (or id'd) element, by setting its innerHTML property. See at the end of my expand_contract example on osiris.

Remember, JavaScript goes between script tags, and is sent by the server as-is to the client. The <noscript> tag is important, since some people disable Javascript, especially when annoyed
<script type="text/javascript">
// javascript statements here
</script>
<noscript>
This will appear if javascript is disabled
</noscript>
HTML here will just be printed
<img onClick="also javascript here " src="me.gif">

Send me your file here

Your Username:
Choose your file:
OR it is on Osiris, name

If you have a jpeg image, use this form again to send it

Document last modified , by Lin Jensen