Fiche TP N 03 Dev App Web
Fiche TP N 03 Dev App Web
Objectif :
The objective of this lab is to apply the key concepts you have learned about JavaScript during the course,
including variables, functions, predefined functions, loops, conditions, interactions, and forms
Definition
JavaScript (JS) is an object-oriented scripting language based on the ECMAScript standard. It is embedded
within the (X)HTML code of a webpage, extending its capabilities and enhancing interactivity. This loosely
typed, object-oriented language is executed on the client side.
Notably, JavaScript can be used to handle styling in place of CSS (see Example 1). It also enables the
creation of interactive web pages and can be integrated with jQuery to manage events and create dynamic
animations.
Exercise 1:
Write a JavaScript function that displays the multiplication table of a given value passed as a parameter.
Before calling the function, the value must be entered through a dialog box.
Exercise 2:
Write a JavaScript script that, upon loading an HTML page, prompts the user for their name through a
dialog box and dynamically updates the browser's title bar with the entered name.
JavaScript allows you to dynamically modify the styling of your webpage, including changing the color
of an element, adjusting its position, resizing it, modifying its borders, hiding it, and much more.
Example 1 :
The getElementById(id) function returns the element with the given ID.
1/5
People's Democratic Republic of Algeria
Ministry of Higher Education and Scientific Research
Faculty of des Sciences and Technologies
University of Ain Témouchent Belhadj Bouchaib
MI Departement
CSS JS
Exercise 03 :
Q1. Create the form as shown in the image below.
Q2. Highlight any unfilled fields and display a message indicating that they are required.
Q3. If the user's age is below 12, display a message informing them that they cannot access the service
provided by the website.
Q4. Add a button to reset the form.
2/5