Workshop Assignment - PowerPoint PPT Presentation

About This Presentation
Title:

Workshop Assignment

Description:

create a single program that uses the form structure to say, ... onclick='displaymessage()' /form /body /html Hints. Start with Hello World program ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 8
Provided by: vincen85
Learn more at: https://cs.hofstra.edu
Category:

less

Transcript and Presenter's Notes

Title: Workshop Assignment


1
WorkshopAssignment 2
2
Assignment Two
  • Using the two programs below that we discussed in
    class...
  • ...create a single program that uses the ltformgt
    structure to say, good morning, or good day,
    or good evening

3
Selection
lthtmlgt ltbodygt ltscript type"text/javascript"gt var
d new Date() var time d.getHours() if (time lt
10) document.write("ltbgtGood morning!lt/bgt") el
se if (timegt10 timelt16) document.write("ltbgtGo
od day!lt/bgt") else document.write("ltbgtGood
evening!lt/bgt") lt/scriptgt lt/bodygt lt/htmlgt
4
Functions
lthtmlgt ltheadgt ltscript type"text/javascript"gt func
tion displaymessage() alert("Hello
World!") lt/scriptgt lt/headgt ltbodygt ltformgt ltinput
type"button" value"Click me!" onclick"displayme
ssage()" gt lt/formgt lt/bodygt lt/htmlgt
5
Hints
  • Start with Hello World program
  • Get the next example programs to work
  • Break things into steps and test
  • Distinguish between ltheadgt and ltbodygt placement
  • Instead of document.write (...) you will use
    alert (...)
  • play with JavaScripthttp//www.w3schools.com/js
    /js_howto.asp

6
Hello World
lthtmlgt ltbodygt ltscript type"text/javascript"gt docu
ment.write("Hello World!") lt/scriptgt lt/bodygt lt/htm
lgt
7
Have A Happy Thanksgiving
See You Next Monday, 11/27
Write a Comment
User Comments (0)
About PowerShow.com