Download presentation
Presentation is loading. Please wait.
2
Page 1 Lecture Exercise ( Wk2) CS1301 Introduction To Computer Programming (07-08 Semester B) www.cs.cityu.edu.hk/~helena Question 1. MATCHING: html comments alert('Hello World!'); document.write('Hello World!'); Question 2. Try to understand the error(s) shown below. Fix it. Syntax: the spelling and grammar of a programming language. * Another common error message is Error: Object expected - Often happens when you mistype something: The browser gives you this message, that means: "I can't understand what you're typing. Please type the name of a valid object here!!". LectEx02_Q2_Debug.html
3
Page 2 Question 4: (To be done after slide #9 is covered) In the screens below, the value is doubled when "double" is clicked. Fill the missing code... document.write (" Welcome to WEEK 2 LECTURE!! "); document.write(" - - " + Date()); Go to Helena's page What time is it?.. Question 3. Write down 4 ways to include JavaScript in an HTML page: (i)Add JavaScript as ______________(ii)Add JavaScript as ______________ (iii)Add JavaScript within _______ and _______(iv)Add JavaScript as a ________________ What parts below are using JavaScript? Highlight them all. LectEx02_Q3_Greeting.html (a) (b) 1 <a href= <a href= LectEx02_Q4_DoubleInSpan.html LectEx02_Q4_DoubleInForm.html
4
Page 3 Question 5. Design a table in html In the HTML code below, all tag names are missed. Guess and fill in as many as possible. Hints: html, body, head, title, h2, b, br, table, td, tr CS1301 Tutorial Sections CS1301 Introduction to Computer Programming Tutorial Sections: Tutorial T01 Tutorial T02 Tutorial T03 Tutorial T04 Mon 2:30pm Wed 12:30pm Tue 12:30pm Tue 1:30pm CSC-D CSC-I CSC-B CSC-C Expected output: LectEx02_Q5_table.html
5
Page 4 Question 6. Which line in the following is wrong? Demo three plus three is equal to six three is smaller than four and three is larger than two three+three=six three two LectEx02_Q6_somethingWrong.html * Html has some special code: >- > <- < - [space]
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.