NEW
Font size
WorksheetsWEB DEV
Total questions: 30
Worksheet time: 15mins
1. What is the DOM in web development?
A database management system
A programming interface for HTML documents
A web server
A JavaScript library
2. What does the DOM tree represent? (1 point)
The JavaScript code structure
The CSS styling hierarchy
The structure of a web page
The server architecture
3. In the DOM tree, what are child nodes? (1 point)
Elements contained within a parent element
The topmost elements in the hierarchy
External resources linked to the document
The server responses
4. What does childNodes return in the DOM? (1 point)
The parent of an element
All sibling elements
A collection of an element's child nodes
The first child of an element
5. What is the significance of parent-child relationships in the DOM? (1 point)
They define the network status
They determine the server response time
They represent the nesting of elements
They control the JavaScript execution
6. Which method returns the next sibling node of an element in the DOM? (1 point)
element.previousSibling
element.parentNode
element.nextSibling
element.firstChild
7. What does firstChild return in the DOM? (1 point)
The first sibling element
The last child node of an element
The parent node of an element
The first child node of an element
8. Which DOM property returns the previous sibling node of an element? (1 point)
nextSibling
parentNode
previousSibling
lastChild
9. Why is understanding the DOM important for web development? (1 point)
It is necessary for database management
It allows manipulation of web page elements using JavaScript
It is the only way to write HTML
It speeds up the website loading time
10. In a DOM tree, which element is typically the immediate parent of the <h1> element in a simple HTML document?
<html>
<head>
<body>
<div>
11. What is the scope of variables declared with let and const in ES6? (1 point)
Global
Function
Block
Object
12. What does the const keyword in ES6 signify about a variable? (1 point)
The variable can be reassigned
The variable type is constant
The variable's value cannot be changed
The variable is constant in scope only
13. How do arrow functions differ from traditional functions in their handling of this?
this is always global in arrow functions
this refers to the parent scope in arrow functions
this is undefined in arrow functions
this can be set manually in arrow functions
14. What is a primary benefit of using arrow functions in ES6? (1 point)
Higher performance
Access to the arguments object
Shorter syntax and no binding of this
Ability to use new keyword
15. Which of the following is true about the let keyword in ES6?
Variables declared with let can be redeclared
let variables are hoisted to the top of the block
let provides block-level scoping
let is a replacement for const
16. What do enhanced object literals in ES6 provide? (1 point)
Improved performance for object creation
Ability to create objects from arrays
More concise syntax for object property and method declaration
Automatic conversion of objects to JSON format
17. Which ES6 feature allows assignment of default values to function parameters?
Arrow functions
Template literals
Destructuring
Default parameters
18. In ES6, what is the purpose of the spread operator...? (1 point)
To concatenate arrays
To expand or spread an iterable into individual elements
To calculate the length of an array
To clone functions
19. What is the main use of the rest parameter in ES6? (1 point)
To represent an indefinite number of arguments as an array
To specify mandatory parameters in a function
To increase the performance of functions
To define a restful API in JavaScript
20. Which statement is true about template literals in ES6? (1 point)
They can only be used for string creation
They use single quotes "`"
They allow embedded expressions and multi-line strings
They are the same as traditional strings
21. Which CSS feature is used in Responsive Web Design to apply different styles for different devices?
Flexbox
Media Queries
Animation
Grid Layout
22. What is the most common media type used in media queries for Responsive Web Design? (1 point)
Screen
Speech
All
23. Which of the following is a common viewport width used for designing mobile interfaces? (1 point)
Max-width: 480px
Max-width: 767px
Max-width: 1024px
Max-width: 1280px
24. What is the role of the viewport meta tag in Responsive Web Design?
To add keywords for SEO
To link external CSS files
To control the layout on mobile browsers
To specify the character set
25. Which of these is a correct syntax for a media query in CSS? (1 point)
@media screen and (max-width: 600px)
@screen (max-width: 600px)
media screen (max-width: 600px}
screen @media (max-width: 600px)
26. What is the purpose of using percentage values in CSS for Responsive Web Design? (1 point)
To increase loading speed
To create more vibrant colors
To make layouts more flexible
To make text easier to read
27. Which of the following is a benefit of Responsive Web Design? (1 point)
Faster server response time
Enhanced User Experience
Increased website security
Easier website translation
28. What happens to a sidebar with the class .sidebar styled with display: none; in a media query under 768px?
It gets hidden
It becomes fixed
It changes color
It moves to the top of the page
29. What does max-width: 100%; do for images in Responsive Web Design?
Increases image resolution
Allows images to scale up beyond their original size
Makes images responsive by allowing them to scale down
Changes the image format
30. What is the effect of setting width in CSS to a relative unit like %? (1 point)
It makes the element fixed size
It ties the element's size to the screen size
It hides the element on smaller screens
It changes the element's color based on screen size
