JavaScript Assignments



Assignment #1

Create a single web page using only HTML code that contains three short sentences or paragraphs of text. A short poem or song lyrics work very nicely. If you are at a loss for words, check out the country music lyric generator at http://www.outofservice.com/country/.

Choose one word in each sentence or paragraph and use JavaScript to display this word as HTML. Change one of the attributes of this word (color, size, font, italics, bold) so that it is easy to identify. You will need 3 separate sets of <SCRIPT> tags to do this.

Using another set of <SCRIPT> tags, create a separate paragraph at the bottom of the page that outputs the following items using only one or more window.document.write() statements:

  • A small picture of yourself (if you don't have one or can't create one, feel free to use an image culled from the web).

  • The type of web browser that the user is viewing this page with (use the navigator.appName property).

  • The date that the page was created or last modified (use the document.lastModified property).

Reading Assignment in JavaScript for the World Wide Web:

Read all of Ch. 1 & Ch.2.