Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Web Development Quiz

Total questions: 19

Worksheet time: 6mins

Name
Class
Date
1.

What does the action attribute in a

tag define?

a)

Form method

b)

CSS class

c)

The URL where the form data is sent

d)

JavaScript validator

2.

Which HTTP method is commonly used to send data to the server?

a)

GET

b)

POST

c)

PUT

d)

DELETE

3.

Which of these is a valid way to get an element in the DOM?

a)

document.getElementById("demo")

b)

window.alert("demo")

c)

document.alertElement("demo")

d)

getElement("demo")

4.

What does JSON.stringify() do in JavaScript?

a)

Parses a JSON string into an object

b)

Converts an object to a JSON string

c)

Validates JSON

d)

Sends JSON to a server

5.

Which PHP superglobal retrieves form data sent using POST?

a)

$_GET

b)

$_POST

c)

$_FORM

d)

$_INPUT

6.

What is the correct way to define a function in JavaScript?

a)

let function = () => {}

b)

function myFunc() { }

c)

def myFunc():

d)

func myFunc()

7.

What is the purpose of addEventListener() in JavaScript?

a)

Adds a class to an element

b)

Attaches a function to run when an event occurs

c)

Changes element color

d)

Binds HTML to CSS

8.

What does innerText change in a DOM element?

a)

Its ID

b)

Its visible text

c)

Its style

d)

Its name attribute

9.

In PHP, what does htmlspecialchars() protect against?

a)

Cross-site scripting (XSS)

b)

SQL injection

c)

Cookie theft

d)

Brute-force attacks

10.

Which method is asynchronous in JavaScript?

a)

fetch()

b)

alert()

c)

prompt()

d)

parseInt()

11.

What does the

a)

Clears the form

b)

Submits the form to the server

c)

Styles the form

d)

Uploads a file

12.

Which of these is NOT a valid JSON value?

a)

String

b)

Object

c)

Number

d)

Function

13.

What will typeof [1,2,3] return in JS?

a)

object

b)

array

c)

list

d)

JSON

14.

Which method removes elements that don’t pass a test?

a)

map()

b)

forEach()

c)

filter()

d)

reduce()

15.

What does setTimeout() do?

a)

Runs code repeatedly

b)

Runs code once after a delay

c)

Cancels a function

d)

Freezes the UI

16.

Which language is primarily used to style web pages?

a)

HTML

b)

JavaScript

c)

CSS

d)

PHP

17.

Which statement is used to output data in PHP?

a)

printData()

b)

echo

c)

console.log

d)

say()

18.

What is a RESTful API?

a)

A desktop application

b)

A web service using HTTP and resources

c)

A server's email service

d)

A JavaScript framework

19.

Which function gets the HTTP request type in PHP?

a)

$_TYPE

b)

$_SERVER["REQUEST_METHOD"]

c)

$_HTTP

d)

request.getMethod()