FBISE, NCP & NBF-aligned resources for Classes 9–12
Browse by Class
Browse by Type
Computer Chapter 3 : Topic 3.5
Use JavaScript to create a dynamic website
1 / 14
A student adds JavaScript to an HTML webpage so that a welcome message changes according to the user's name. What is the main purpose of using JavaScript in this situation?
Reasoning: JavaScript adds interactivity and dynamic behavior to webpages.
2 / 14
A webpage displays the same information to every visitor. After JavaScript is added, the content changes based on user actions. What type of website has been created?
Reasoning: Dynamic websites can change content in response to user input or events.
3 / 14
A button on a webpage changes the text of a paragraph when clicked. Which feature of JavaScript is being demonstrated?
Reasoning: JavaScript can modify webpage content while the page is running.
4 / 14
A student creates a webpage where clicking a button hides an image and clicking another button shows it again. How does this make the website dynamic?
Reasoning: Dynamic websites react to user interactions in real time.
5 / 14
A website updates the number of items in a shopping cart immediately after a product is selected. Which role of JavaScript is illustrated here?
Reasoning: JavaScript can update displayed information without reloading the page.
6 / 14
A developer uses JavaScript to change the background color of a webpage when a user selects a theme. What aspect of the website is being modified?
Reasoning: JavaScript can dynamically modify CSS properties.
7 / 14
A webpage validates user input and displays an error message if a required field is empty. Why is JavaScript useful in this scenario?
Reasoning: JavaScript can check input and respond instantly.
8 / 14
A news website automatically displays the latest headlines without requiring users to refresh the page. Which characteristic of a dynamic website is demonstrated?
Reasoning: Dynamic websites can update content automatically.
9 / 14
A programmer creates a JavaScript function that adds new items to a list whenever a user submits information. What does this demonstrate?
Reasoning: JavaScript can create and insert new HTML elements dynamically.
10 / 14
Which situation best shows JavaScript transforming a static HTML page into a dynamic website?
Reasoning: Dynamic websites adapt content according to user actions.
11 / 14
A webpage contains a button that increases the font size of text whenever it is clicked. Which capability of JavaScript is being used?
Reasoning: JavaScript can alter CSS properties to change appearance.
12 / 14
A login page uses JavaScript to display "Welcome Back" immediately after successful login. Why is this considered a dynamic feature?
Reasoning: Dynamic content changes based on events and user interactions.
13 / 14
A teacher asks students to identify the main benefit of using JavaScript with HTML. Which answer is most appropriate?
Reasoning: JavaScript enhances HTML by adding interaction and dynamic behavior.
14 / 14
A student develops a webpage where images, text, and styles change automatically according to user preferences. Which statement best describes the result?
Reasoning: JavaScript can modify HTML and CSS to create dynamic, personalized webpages.
Your score is
Restart quiz