wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Web Development Quiz

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

What does `let` do in JavaScript?

a)

Declares a constant variable

b)

Declares a block-scoped variable

c)

Declares a global variable

d)

Creates a function

2.

Which operator is used for strict equality?

a)

=

b)

==

c)

===

d)

:=

3.

What is the output of `typeof null`?

a)

null

b)

object

c)

undefined

d)

string

4.

What does `parseInt("10.5")` return?

a)

10.5

b)

10

c)

11

d)

NaN

5.

What is the result of `true && false`?

a)

false

b)

true

c)

null

d)

undefined

6.

Which function is used to delay execution?

a)

delay()

b)

setTimeout()

c)

setInterval()

d)

wait()

7.

What is the output of `Boolean(0)`?

a)

0

b)

false

c)

true

d)

null

8.

Which method adds an element to the end of an array?

a)

pushFront()

b)

push()

c)

insert()

d)

append()

9.

What does `map()` do in JavaScript arrays?

a)

Filters elements

b)

Sorts elements

c)

Transforms each element and returns a new array

d)

Modifies the original array

10.

Which symbol starts a comment in JavaScript?

a)

#

b)

//

c)

%%

11.

What does DOM stand for?

a)

Data Object Management

b)

Document Object Model

c)

Dynamic Output Model

d)

Document Output Module

12.

Which method creates a new element in DOM?

a)

newElement()

b)

createElement()

c)

addElement()

d)

makeElement()

13.

Which method adds an element to the DOM?

a)

append()

b)

appendChild()

c)

addChild()

d)

insert()

14.

What is `innerHTML` used for?

a)

Change styles

b)

Set attributes

c)

Get/set HTML content inside an element

d)

Create a new element

15.

Which event is triggered when a button is clicked?

a)

change

b)

hover

c)

click

d)

focus

16.

What does `querySelector("#id")` select?

a)

All elements with a class

b)

All elements with an ID

c)

The first element with that ID

d)

Every element in the document

17.

What is the result of `getElementById("x").value`?

a)

The HTML content

b)

The user input in the field

c)

The CSS style

d)

The element's tag name

18.

Which method removes a node from the DOM?

a)

delete()

b)

remove()

c)

removeChild()

d)

eraseNode()

19.

What does `addEventListener("click", myFunc)` do?

a)

Deletes the event

b)

Prevents default action

c)

Runs `myFunc` when the element is clicked

d)

Adds a hover style

20.

How do you prevent form submission with JavaScript?

a)

stopForm()

b)

event.preventDefault()

c)

clearForm()

d)

return false

21.

Which tag is used to start PHP code?

a)

<php>

b)

<?php

c)

{php}

d)

<?>

22.

Which symbol is used to declare a variable in PHP?

a)

@

b)

$

c)

#

d)

&

23.

How do you output text in PHP?

a)

write()

b)

printLine()

c)

echo

d)

log()

24.

What does `$_POST["email"]` do?

a)

Sends a request

b)

Retrieves submitted form data by name

c)

Saves cookies

d)

Reads the URL

25.

What is the purpose of `htmlspecialchars()`?

a)

Prevents XSS by escaping HTML tags

b)

Connects to databases

c)

Hashes passwords

d)

Parses URLs

26.

Which operator is used to concatenate strings in PHP?

a)

+

b)

.

c)

&

d)

%

27.

What will `count([1,2,3])` return?

a)

2

b)

4

c)

3

d)

true

28.

How do you write a single-line comment in PHP?

a)

# comment

b)

c)

// comment

d)

/** comment */

29.

Which function checks if a form is submitted via POST?

a)

post()

b)

getMethod()

c)

$_SERVER["REQUEST_METHOD"] == "POST"

d)

isPost()

30.

Which file extension is required for PHP files?

a)

.html

b)

.js

c)

.php

d)

.txt