Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Web Development Fundamentals Quiz

Total questions: 95

Worksheet time: 32mins

Name
Class
Date
1.

Which of the following is a valid Tailwind CSS class for setting the text color to blue?

a)

text-blue-500

b)

color-blue

c)

blue-text

d)

font-blue

2.

Which of the following is a primitive data type in JavaScript?

a)

Array

b)

String

c)

Object

d)

Function

3.

What does the "md:" prefix in Tailwind CSS indicate?

a)

Margin direction

b)

Medium screen size breakpoint

c)

Minimum display

d)

Main display

4.

Which keyword is used to declare a function in JavaScript?

a)

define

b)

function

c)

method

d)

declare

5.

Which Tailwind CSS utility class is used to add padding to all sides of an element?

a)

p-4

b)

m-4

c)

pad-4

d)

padding-4

6.

Which method is used in JavaScript to select an element by its ID from the DOM?

a)

getElementByClass

b)

getElementById

c)

selectById

d)

querySelectorAll

7.

Which of the following best describes the purpose of responsive design?

a)

To make websites load faster

b)

To ensure websites look good on all device sizes

c)

To add animations to web pages

d)

To improve website security

8.

Which of the following is the correct way to define a function that takes two parameters and returns their sum in JavaScript?

a)

function sum(a, b) { return a + b; }

b)

function sum(a, b) = a + b;

c)

sum(a, b) => a + b;

d)

function sum = (a, b) { return a + b; }

9.

Given the Tailwind CSS class "flex justify-center items-center", what is the layout effect on a container?

a)

The container's content is aligned to the top left

b)

The container's content is centered both vertically and horizontally

c)

The container's content is spaced evenly

d)

The container's content is aligned to the bottom right

10.

Which JavaScript data type would be most appropriate to store a list of student names?

a)

String

b)

Array

c)

Number

d)

Boolean

11.

How would you use Tailwind CSS to make an image responsive so it scales with the width of its container?

a)

Add the class "w-full" to the image

b)

Add the class "img-responsive"

c)

Add the class "scale-100"

d)

Add the class "container"

12.

Which JavaScript method would you use to change the text content of a paragraph with the ID "demo"?

a)

document.getElementById("demo").innerText = "New text";

b)

document.getElementByClass("demo").text = "New text";

c)

document.querySelector("demo").textContent = "New text";

d)

document.getElementById("demo").setText("New text");

13.

A developer wants to create a navigation bar that collapses into a hamburger menu on small screens using Tailwind CSS. Which approach best demonstrates the use of responsive design principles?

a)

Use "hidden md:block" for the menu and "block md:hidden" for the hamburger icon

b)

Use "block" for both menu and hamburger icon

c)

Use "flex" for the menu and "hidden" for the hamburger icon

d)

Use "inline" for the menu and "block" for the hamburger icon

14.

Given the following code, what will be the output? ```javascript let x = "5"; let y = 2; console.log(x + y); ```

a)

7

b)

"52"

c)

10

d)

"7"

15.

You want to add a shadow effect to a card component using Tailwind CSS. Which utility class should you use?

a)

shadow-lg

b)

border-lg

c)

bg-shadow

d)

card-shadow

16.

Suppose you have a button with the ID "submitBtn". Write the JavaScript code to add a click event listener that logs "Submitted!" to the console.

a)

document.getElementById("submitBtn").addEventListener("click", function() { console.log("Submitted!"); });

b)

document.getElementById("submitBtn").onClick = function() { console.log("Submitted!"); };

c)

document.getElementById("submitBtn").click(function() { console.log("Submitted!"); });

d)

document.getElementById("submitBtn").addEvent("click", function() { console.log("Submitted!"); });

17.

You are tasked with creating a responsive grid layout using Tailwind CSS that displays 1 column on small screens and 3 columns on medium and larger screens. Which class combination should you use?

a)

grid-cols-1 md:grid-cols-3

b)

grid-cols-3 md:grid-cols-1

c)

col-1 md:col-3

d)

grid-1 md:grid-3

18.

A user wants to toggle the visibility of a div when a button is clicked. Which JavaScript approach would best achieve this?

a)

Add or remove a "hidden" class from the div using classList.toggle in the button's click event handler

b)

Change the div's color property

c)

Set the div's innerHTML to an empty string

d)

Use alert to show the div

19.

You are given a list of user objects in JavaScript. Write a function that returns the names of users who are older than 18.

a)

function getAdultNames(users) { return users.filter(u => u.age > 18).map(u => u.name); }

b)

function getAdultNames(users) { return users.map(u => u.name); }

c)

function getAdultNames(users) { return users.filter(u => u.age < 18).map(u => u.name); }

d)

function getAdultNames(users) { return users.filter(u => u.name > 18); }

20.

A web page uses Tailwind CSS for styling and needs to support both light and dark modes. How can you strategically use Tailwind CSS utilities to achieve this?

a)

Use "bg-white text-black" for light mode and "dark:bg-black dark:text-white" for dark mode

b)

Use only "bg-black text-white" for all modes

c)

Use "bg-gray-500 text-gray-500" for both modes

d)

Use "bg-light text-dark" for light mode and "bg-dark text-light" for dark mode

21.

Which Tailwind CSS class would you use to add a border with a width of 2 pixels to an element?

a)

border-2

b)

bordered-2

c)

border-width-2

d)

bd-2

22.

What is the result of the following JavaScript code?

let arr = [1, 2, 3];
console.log(arr.length);

a)

undefined

b)

1

c)

3

d)

2

23.

Which method would you use in JavaScript to convert a string to an integer?

a)

parseInt()

b)

toString()

c)

parseFloat()

d)

Number.isInteger()

24.

Which Tailwind CSS class would you use to make text bold?

a)

text-bold

b)

font-bold

c)

bold-text

d)

font-weight-bold

25.

What is the output of the following JavaScript code?

let str = "Hello";
console.log(str.length);

a)

6

b)

5

c)

4

d)

undefined

26.

Which JavaScript method can be used to add a new element to the end of an array?

a)

concat()

b)

shift()

c)

pop()

d)

push()

27.

Which Tailwind CSS class would you use to set the background color of an element to red?

a)

bg-red-500

b)

background-red

c)

color-red-500

d)

red-bg

28.

What is the output of the following JavaScript code?

let num = 10;
console.log(typeof num);

a)

"string"

b)

"object"

c)

10

d)

"number"

29.

Which JavaScript method would you use to remove the first element from an array?

a)

splice()

b)

pop()

c)

shift()

d)

unshift()

30.

Which Tailwind CSS class would you use to add a border with a width of 2 pixels to an element?

a)

border-2

b)

border2

c)

border-thick

d)

border-width-2

31.

What is the output of the following JavaScript code?

let arr = [10, 20, 30];
console.log(arr[1]);

a)

10

b)

20

c)

30

d)

undefined

32.

Which JavaScript method can be used to join all elements of an array into a single string?

a)

concat()

b)

join()

c)

push()

d)

split()

33.

Which Tailwind CSS utility class would you use to center text horizontally within an element?

a)

justify-center

b)

align-center

c)

center-text

d)

text-center

34.

What is the output of the following JavaScript code?

let fruits = ["apple", "banana", "cherry"];
console.log(fruits.indexOf("banana"));

a)

0

b)

1

c)

2

d)

-1

35.

Which JavaScript method can be used to execute a function for each element in an array?

a)

filter()

b)

map()

c)

forEach()

d)

reduce()

36.

Which Tailwind CSS utility class would you use to add a shadow effect to an element?

a)

shadow-effect

b)

shadowed

c)

box-shadow

d)

shadow

37.

What is the correct way to declare a constant variable in JavaScript?

a)

constant myVar = 10;

b)

var myVar = 10;

c)

const myVar = 10;

d)

let myVar = 10;

38.

Which Tailwind CSS class would you use to make text bold?

a)

fontweight-bold

b)

bold-text

c)

text-bold

d)

font-bold

39.

Which JavaScript method would you use to check if a variable is an array?

a)

Array.isArray()

b)

checkArray()

c)

isArray()

d)

typeof array

40.

Which Tailwind CSS class would you use to set the background color to green?

a)

bg-green-500

b)

background-green

c)

color-green-500

d)

green-bg

41.

What is the result of the following JavaScript code?

let str = "Hello";
console.log(str.length);

a)

4

b)

5

c)

undefined

d)

"Hello"

42.

Which JavaScript method is used to remove the last element from an array?

a)

shift()

b)

pop()

c)

splice()

d)

remove()

43.

Which Tailwind CSS class would you use to center text horizontally within an element?

a)

text-center

b)

align-center

c)

justify-center

d)

center-text

44.

What is the output of the following JavaScript code?

let a = 3;
let b = '3';
console.log(a == b);

a)

TypeError

b)

undefined

c)

true

d)

false

45.

Which JavaScript method adds one or more elements to the end of an array and returns the new length?

a)

pop()

b)

push()

c)

shift()

d)

unshift()

46.

Which Tailwind CSS class would you use to add padding of 4 units to all sides of an element?

a)

pad-4

b)

pl-4

c)

padding-4

d)

p-4

47.

What is the output of the following JavaScript code?

let colors = ["red", "green", "blue"];
console.log(colors.includes("green"));

a)

undefined

b)

false

c)

true

d)

"green"

48.

Which Tailwind CSS utility class would you use to add padding of 4 units to all sides of an element?

a)

pad-4

b)

pd-4

c)

padding-4

d)

p-4

49.

What is the output of the following JavaScript code?

let nums = [1, 2, 3];
console.log(nums.length);

a)

2

b)

3

c)

undefined

d)

1

50.

Which JavaScript method can be used to remove the first element from an array?

a)

pop()

b)

shift()

c)

splice()

d)

remove()

51.

Which Tailwind CSS class would you use to make text bold?

a)

font-bold

b)

bold-text

c)

text-bold

d)

font-weight-bold

52.

Which JavaScript method is used to add a new element to the end of an array?

a)

push()

b)

add()

c)

append()

d)

insert()

53.

What Tailwind CSS class would you use to give an element rounded corners?

a)

round-corner

b)

rounded

c)

border-radius

d)

corner-round

54.

Which JavaScript method would you use to combine two arrays into one?

a)

join()

b)

split()

c)

merge()

d)

concat()

55.

Which Tailwind CSS utility class would you use to make text bold?

a)

font-weight-bold

b)

font-bold

c)

text-bold

d)

bold-text

56.

What is the output of the following JavaScript code?

let arr = [1, 2, 3];
arr.push(4);
console.log(arr.length);

a)

3

b)

undefined

c)

4

d)

5

57.

Which JavaScript method removes the last element from an array and returns that element?

a)

push()

b)

shift()

c)

pop()

d)

unshift()

58.

Which Tailwind CSS class would you use to set the background color of an element to red?

a)

bg-red-500

b)

background-red

c)

color-red-500

d)

red-bg

59.

What is the output of the following JavaScript code?

let arr = [10, 20, 30];
console.log(arr[1]);

a)

30

b)

20

c)

10

d)

undefined

60.

Which JavaScript method removes the last element from an array and returns that element?

a)

pop()

b)

shift()

c)

splice()

d)

remove()

61.

Which Tailwind CSS class would you use to add a margin of 8 units to the top of an element?

a)

mt-8

b)

margin-top-8

c)

top-8

d)

m-8

62.

What is the output of the following JavaScript code?

let arr = [1, 2, 3];
console.log(arr.length);

a)

3

b)

1

c)

2

d)

undefined

63.

A collection of interlinked web pages on the World Wide Web

a)

website

b)

content

c)

footprint

d)

heading

64.

HTML stands for

a)

Hypretext Markup Language

b)

Hypertext Media Language

c)

Hyper Text Marker Line

d)

Hypertext Mangement List

65.

The structure of a web page is primarily created with which of the following?

a)

HTML

b)

CSS

c)

Javascript

d)

C++

66.

Which web development tools would I use if I wanted my web page to have specific colors and style?

a)

HTML

b)

CSS

c)

Javascript

d)

PHP

67.

The difference between a beginning tag and ending tag is the...

a)

/

b)

\

c)

;

d)

:

68.

A web document must have which of the following tags?(multiple choice qn)

a)

<html>

b)

<body>

c)

<p>

d)

<img>

e)

<head>

69.

To "style" a font in a specific type, which "property" would I use?

a)

font-style

b)

font-type

c)

font-family

d)

font-"name of font"

70.

The structure of an html document will fall in between which tags?

a)

<body></body>

b)

<head></head>

c)

<title></title>

d)

<p></p>

71.

Change the border size of the body or image

a)

border-style

b)

border-width

c)

border-color

d)

width

72.

sets the element to one side of the page

a)

margin

b)

width

c)

float

d)

height

73.

sets the color of words in a paragraph

a)

h1 {

color: pink;

}

b)

img {

color: pink;

}

c)

body {

color: pink;

}

d)

p {

color: pink;

}

74.

What does a class do?

a)

adds color to words

b)

adds style to specific elements

c)

adds style to a whole page

d)

adds a lot more work

75.

Select the rule set to make all the text in your web page blue and centered.

a)

p {

color: blue;

}

b)

body {

text-align: left;

color: blue;

}

c)

p {

text-align: center;

color: blue;

}

d)

body {

text-align: center;

color: blue;

}

76.

Which selector will change the font of the text?

a)

font-size

b)

text-align

c)

font-famiy

d)

text-decoration

77.

Which rule set would change the font size to 24?

a)

font-size: 24

b)

size: 24;

c)

font-size: 24;

d)

font size: 24;

78.

Which tag is used to add an image?

a)

<image>

b)

<img>

c)

<<img>>

d)

</image>

79.

What symbol should you use to target an id in css?

a)

.

b)

+

c)

id

d)

#

80.

What is the correct syntax to change the background color with css?

a)

background-color: purple;

b)

background-color = "purple";

c)

backgroundcolor=orange

d)

change-background-color: purple

81.

What is missing from this HTML skeleton?


<!DOCTYPE html>

<html>

<body>

</body>

</html>

a)

<head></head>

b)

<div></div>

c)

<img></img>

d)

<head>

82.
What does CSS stand for? 
a)
Creative Style Sheets
b)
Cascading Style Sheets
c)
Colorful Style Spread
d)
Computer Style Spread
83.

What is the correct HTML for making a checkbox?

a)

<checkbox>

b)

<input type="checkbox">

c)

<check>

d)

<input type="check">

84.

What is the correct HTML for making a drop-down list?

a)

<list>

b)

<input type="dropdown">

c)

<input type="list">

d)

<select>

85.

1.Which of the following is the correct tag to create a text box?

a)

<input> text </input>

b)

<text>

c)

<input = “text”>

d)

<input type = “text”>

86.

Freya and Leo are helping Benjamin design a website for a local community center. What is the main purpose of web accessibility?

a)

To make websites look more attractive

b)

To ensure websites are usable by people with disabilities

c)

To increase website loading speed

d)

To improve website security

87.

In what attribute of the <form> tag is the form handler stated?

a)

method

b)

server

c)

action

d)

type

88.

Is <input type="combobox"> a valid HTML Form statement.

a)

True

b)

False

89.

6. The web developer wants to make the "My Page" text larger. Which TWO of the following would work? (Choose TWO)

a)

Use <h6> instead of <h3>

b)

Use <h1> instead of <h3>

c)

Put the "My Page" text inside the tags

d)

Use CSS to set the font-size property of the h3 tag

90.

5. What code in the stylesheet could have made the text green? (Choose TWO)

a)
b)
c)
d)
91.
Which term describes a named set of JavaScript statements that performs a task or calculates a value, can be used multiple times, and can be processed or invoked by other parts of the script?
a)
An event
b)
A parameter
c)
An object
d)
A function
92.
What is the proper function to call to print to the screen?
a)
write
b)
console.log
c)
print
d)
log
e)
console.print
93.

What is a function in JavaScript?

a)

A piece of code that can be called by other parts of your program

b)

A variable that stores numbers

c)

A loop that executes a set number of times

d)

An error message

94.

How do you create a function in JavaScript?

a)


function myFunction()

b)

function = myFunction()

c)

new function = myFunction()

d)

create function myFunction()

95.
JavaScript
a)
a programming language used to create pages that respond differently to different user actions
b)
gives the browser the path to the CSS file used to style the page
c)
tells the browser where to find the CSS file used to style the page
d)
These can be used to select the color of an object