|
Staff
|
JavaScript Lab DayNovember 18, 2010 SetupIf you didn't do this last week: Create a new directory ~/public_html/cs312/labs for your lab exercises and set the permissions so that it the web server (anyone) can access it (chmod 755 ~/public_html/cs312/labs).
Create a webpage named For the HTML file, make sure that you load the external JavaScript file in the head section. SubmissionAs you complete each lab exercise, let me know and I'll come check it out. Debugging
Lab Exercises1) Event Handlersa) Write the XHTML tag and event handler to pop up an alert message that says "Welcome" when the user clicks a button. b) Write the XHTML tag and event handler to pop up an alert message that says "Welcome" when the user moves the mouse pointer over a link that says "Hover for a welcome message". Note that you only need to write one JavaScript function to complete both parts of this exercise. 2) Form Access and Dynamic PagesCreate a form that asks the user to enter their name, age, and hometown. When the user presses the Submit button, call a JavaScript function. The JavaScript function should perform the following actions:
3) Rollover ImageUse JavaScript to create a rollover image. Choose two images with the same size. Display one image. When the mouse passes over the image, change it to the second image. When the mouse leaves the image, change back to the original image. If you can't find two images that you like, you can use these: |