wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

WEB DEV

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

1. What is the DOM in web development?

a)

A database management system

b)

A programming interface for HTML documents

c)

A web server

d)

A JavaScript library

2.

2. What does the DOM tree represent? (1 point)

a)

The JavaScript code structure

b)

The CSS styling hierarchy

c)

The structure of a web page

d)

The server architecture

3.

3. In the DOM tree, what are child nodes? (1 point)

a)

Elements contained within a parent element

b)

The topmost elements in the hierarchy

c)

External resources linked to the document

d)

The server responses

4.

4. What does childNodes return in the DOM? (1 point)

a)

The parent of an element

b)

All sibling elements

c)

A collection of an element's child nodes

d)

The first child of an element

5.

5. What is the significance of parent-child relationships in the DOM? (1 point)

a)

They define the network status

b)

They determine the server response time

c)

They represent the nesting of elements

d)

They control the JavaScript execution

6.

6. Which method returns the next sibling node of an element in the DOM? (1 point)

a)

element.previousSibling

b)

element.parentNode

c)

element.nextSibling

d)

element.firstChild

7.

7. What does firstChild return in the DOM? (1 point)

a)

The first sibling element

b)

The last child node of an element

c)

The parent node of an element

d)

The first child node of an element

8.

8. Which DOM property returns the previous sibling node of an element? (1 point)

a)

nextSibling

b)

parentNode

c)

previousSibling

d)

lastChild

9.

9. Why is understanding the DOM important for web development? (1 point)

a)

It is necessary for database management

b)

It allows manipulation of web page elements using JavaScript

c)

It is the only way to write HTML

d)

It speeds up the website loading time

10.

10. In a DOM tree, which element is typically the immediate parent of the <h1> element in a simple HTML document?

a)

<html>

b)

<head>

c)

<body>

d)

<div>

11.

11. What is the scope of variables declared with let and const in ES6? (1 point)

a)

Global

b)

Function

c)

Block

d)

Object

12.

12. What does the const keyword in ES6 signify about a variable? (1 point)

a)

The variable can be reassigned

b)

The variable type is constant

c)

The variable's value cannot be changed

d)

The variable is constant in scope only

13.

13. How do arrow functions differ from traditional functions in their handling of this?

a)

this is always global in arrow functions

b)

this refers to the parent scope in arrow functions

c)

this is undefined in arrow functions

d)

this can be set manually in arrow functions

14.

14. What is a primary benefit of using arrow functions in ES6? (1 point)

a)

Higher performance

b)

Access to the arguments object

c)

Shorter syntax and no binding of this

d)

Ability to use new keyword

15.

15. Which of the following is true about the let keyword in ES6?

a)

Variables declared with let can be redeclared

b)

let variables are hoisted to the top of the block

c)

let provides block-level scoping

d)

let is a replacement for const

16.

16. What do enhanced object literals in ES6 provide? (1 point)

a)

Improved performance for object creation

b)

Ability to create objects from arrays

c)

More concise syntax for object property and method declaration

d)

Automatic conversion of objects to JSON format

17.

17. Which ES6 feature allows assignment of default values to function parameters?

a)

Arrow functions

b)

Template literals

c)

Destructuring

d)

Default parameters

18.

18. In ES6, what is the purpose of the spread operator...? (1 point)

a)

To concatenate arrays

b)

To expand or spread an iterable into individual elements

c)

To calculate the length of an array

d)

To clone functions

19.

19. What is the main use of the rest parameter in ES6? (1 point)

a)

To represent an indefinite number of arguments as an array

b)

To specify mandatory parameters in a function

c)

To increase the performance of functions

d)

To define a restful API in JavaScript

20.

20. Which statement is true about template literals in ES6? (1 point)

a)

They can only be used for string creation

b)

They use single quotes "`"

c)

They allow embedded expressions and multi-line strings

d)

They are the same as traditional strings

21.

21. Which CSS feature is used in Responsive Web Design to apply different styles for different devices?

a)

Flexbox

b)

Media Queries

c)

Animation

d)

Grid Layout

22.

22. What is the most common media type used in media queries for Responsive Web Design? (1 point)

a)

Print

b)

Screen

c)

Speech

d)

All

23.

23. Which of the following is a common viewport width used for designing mobile interfaces? (1 point)

a)

Max-width: 480px

b)

Max-width: 767px

c)

Max-width: 1024px

d)

Max-width: 1280px

24.

24. What is the role of the viewport meta tag in Responsive Web Design?

a)

To add keywords for SEO

b)

To link external CSS files

c)

To control the layout on mobile browsers

d)

To specify the character set

25.

25. Which of these is a correct syntax for a media query in CSS? (1 point)

a)

@media screen and (max-width: 600px)

b)

@screen (max-width: 600px)

c)

media screen (max-width: 600px}

d)

screen @media (max-width: 600px)

26.

26. What is the purpose of using percentage values in CSS for Responsive Web Design? (1 point)

a)

To increase loading speed

b)

To create more vibrant colors

c)

To make layouts more flexible

d)

To make text easier to read

27.

27. Which of the following is a benefit of Responsive Web Design? (1 point)

a)

Faster server response time

b)

Enhanced User Experience

c)

Increased website security

d)

Easier website translation

28.

28. What happens to a sidebar with the class .sidebar styled with display: none; in a media query under 768px?

a)

It gets hidden

b)

It becomes fixed

c)

It changes color

d)

It moves to the top of the page

29.

29. What does max-width: 100%; do for images in Responsive Web Design?

a)

Increases image resolution

b)

Allows images to scale up beyond their original size

c)

Makes images responsive by allowing them to scale down

d)

Changes the image format

30.

30. What is the effect of setting width in CSS to a relative unit like %? (1 point)

a)

It makes the element fixed size

b)

It ties the element's size to the screen size

c)

It hides the element on smaller screens

d)

It changes the element's color based on screen size