Lab 4-Manual-CS314-JavaScript
Lab 4-Manual-CS314-JavaScript
1. Objectives
Apply the client-side web development languages such as HTML/HTML5, CSS3, and JavaScript
In this lab, you will learn the basics of JavaScript programming and how to use it to suit
your professional and creative goals. Upon completion of this course, you will be able to:
Develop the syntax and structure of JavaScript programs, including statements, expressions,
variables, and operators. Collect values using loops, arrays, and objects. Add and remove web
page elements using the Document Object Model (DOM). Validate and respond to user input
using functions and events.
2. Introduction
The topic of Lab 4 provides an introduction to JavaScript and HTML/HTML5, CSS, we will
be introducing you to JavaScript Control flow, Functions, Arrays, Objects, DOM
manipulation, Learn the tree structure of HTML based websites.
The labs for CS-314 provide time to do computer science under the direction of an
instructor who will be serving as a facilitator during the lab session. This means that the
instructor will not solve your problems or show you how to complete the activities. The
instructor may provide helpful hints, ask additional questions, ask you to explain a
solution, ask how you obtained a solution, or facilitate discussions about observations,
experiments, results, discoveries, and other topics that arise.
Some lab activities will ask you to develop solutions to problems, program solutions in
Web Application Development, and test the programs. Other activities will involve using
programs we give you to illustrate important concepts in Computer Science. You will be
required to make observations, form and test hypotheses, and use the results of your
testing to change aspects of your programs.
CS 314 –
Web Application Development Lab Script
Date: / /
PART 1: JavaScript features (Alert, Event Handler, Event, If statement, If Else statement,
If Else If statement, While loop statement, for loop statement)
2.Event Handler
CS 314 –
Web Application Development Lab Script
Date: / /
CS 314 –
Web Application Development Lab Script
Date: / /
3.Formatting
CS 314 –
Web Application Development Lab Script
Date: / /
4.While loop statement
CS 314 –
Web Application Development Lab Script
Date: / /
Your Tasks
Task 1:
The Goal of this Task:
Demonstrate knowledge of basic JavaScript through building the following pages:
1.create HTML page with the following JavaScript Popup Boxes:
A: prompt, ask the user to enter the name
b: alert
what is the difference?
2.create HTML page with input form that read the user name and button that has
event (onclick) which display hi massage with the user name.
3- create JS code that change the format of the HTML.
4- create JS code with While loop statement
5-create JS code with For loop statement
6-create JS code with IF, Else Statement
Assessment
Students will prepare a report in which they will submit the snapshots taken while they worked on each
part. They will explain the figures to make sure that they understood what they did.
Note: Any submission crossing the deadline will be penalized by 10% reduction per day.