WorksheetsMastering Web Development Concepts
Total questions: 29
Worksheet time: 15mins
What does HTML stand for?
HyperText Markup Code
HyperText Multi Language
HyperText Markup Language
HighText Markup Language
Which HTML tag is used to define an internal style sheet?
What is the purpose of the
tag in HTML?The
tag is used to contain meta-information about the HTML document.The
tag is used to create hyperlinks to other pages.The
tag is for including images and videos in HTML.The
tag is used to define the main content of the page.What does CSS stand for?
Cascading Style Sheets
Cascading System Styles
Cascading Style Standards
Cascading Style Scripts
Which property is used to change the background color in CSS?
background-color
bg-color
color-background
background-style
How can you apply a CSS style to an HTML element?
You must use only inline styles for CSS application.
You can apply CSS styles using inline styles, internal styles, or external stylesheets.
CSS styles can only be applied through HTML attributes.
You can apply CSS styles using JavaScript functions.
What is the difference between class and ID selectors in CSS?
Class selectors (#) can only target one element; ID selectors (.) can target multiple elements.
Class selectors (.) are more specific than ID selectors (#) in CSS.
Class selectors (.) can target multiple elements; ID selectors (#) target a single unique element.
ID selectors (#) can be reused across multiple elements; class selectors (.) cannot.
What is JavaScript primarily used for?
Mobile app development with Swift.
Data analysis with Python.
Web development, particularly for interactive front-end applications.
Game development using Unity.
How do you declare a variable in JavaScript?
You declare a variable using 'define' or 'assign'.
You can only use 'var' for variable declaration.
You declare a variable using 'var', 'let', or 'const'.
Variables are declared with 'declare' or 'set'.
What is the purpose of the 'console.log()' function in JavaScript?
To create pop-up alerts on the webpage.
To store data in the browser's local storage.
To format strings for display in HTML.
To output messages to the web console for debugging purposes.
How do you create a function in JavaScript?
function myFunction() { // function body } or const myFunction = () => { // function body }
function: myFunction() { // logic }
create myFunction() { // code here }
const myFunction = function() { // implementation }
What is an event in JavaScript?
An event in JavaScript is a function that executes on a timer.
An event in JavaScript is a variable that stores user input.
An event in JavaScript is an action or occurrence that the browser can detect and respond to.
An event in JavaScript is a method that manipulates the DOM.
How can you add a comment in JavaScript?
Use '/*' for single-line comments and '//' for multi-line comments.
Use '//' for multi-line comments and '###' for single-line comments.
Use '//' for single-line comments and '/* ... */' for multi-line comments.
Use '#' for single-line comments and '/* ... */' for multi-line comments.
What is the difference between '==' and '===' in JavaScript?
'==' allows type conversion; '===' does not.
'==' is for equality; '===' is for assignment.
'==' checks value only; '===' checks value and type.
'==' is faster; '===' is slower in execution.
What is the DOM in relation to JavaScript?
The DOM is a programming interface for web documents that allows JavaScript to manipulate the document structure and content.
The DOM is a server-side framework for web applications.
The DOM is a style sheet language for web design.
The DOM is a database for storing JavaScript variables.
How do you select an element by its ID in JavaScript?
document.querySelector('#yourElementId');
getElementById('yourElementId');
document.getElementByIdById('yourElementId');
document.getElementById('yourElementId');
What is the purpose of the 'this' keyword in JavaScript?
The 'this' keyword refers to the last object created in the code.
The 'this' keyword is a way to define functions in JavaScript.
The 'this' keyword is used to refer to the current execution context or object.
The 'this' keyword is used to declare global variables.
How can you prevent a form from submitting in JavaScript?
Call return false in the submit handler.
Use form.submit() to send the data.
Set the form's action attribute to null.
Use event.preventDefault() in the submit event handler.
What is a callback function in JavaScript?
A callback function is a function that runs in parallel with another function.
A callback function is a function passed as an argument to another function, executed after a certain event or operation.
A callback function is a variable that stores a function for later use.
A callback function is a method that returns a value immediately after execution.
What is the purpose of the 'addEventListener' method in JavaScript?
To add a new element to the DOM.
To attach an event handler to a specified element.
To remove an event handler from an element.
To create a new event type in JavaScript.
What does the 'fetch' API do in JavaScript?
It manipulates the CSS styles of an element.
It creates a new HTML element.
It sends data to a server synchronously.
It retrieves data from a server asynchronously.
How do you create a CSS class selector?
Use a colon (:) followed by the class name.
Use an asterisk (*) followed by the class name.
Use a hash (#) followed by the class name.
Use a dot (.) followed by the class name.
What is the purpose of the 'setTimeout' function in JavaScript?
To pause the execution of the script until a condition is met.
To create a loop that runs indefinitely.
To execute a function immediately without delay.
To delay the execution of a function for a specified number of milliseconds.
How do you create a CSS grid layout?
By setting 'float: left;' on the child elements.
By using the 'grid' property in the CSS.
By applying 'display: flex;' to the container.
By using 'display: grid;' on the parent element.
What is the purpose of the 'return' statement in a function?
To define the function's parameters.
To log output to the console.
To create a new variable within the function.
To exit the function and return a value to the caller.
What is the purpose of the 'map' method in JavaScript arrays?
To create a new array by applying a function to each element of the original array.
To filter elements based on a condition.
To find the first element that matches a condition.
To sort the elements of an array in ascending order.
What does the 'display: flex;' property do in CSS?
It allows the container to align its children in a flexible manner.
It hides the container from the view.
It creates a grid layout for the container.
It sets the container to a block-level element.
How do you add an external JavaScript file to an HTML document?
