WorksheetsWeb Development Quiz
Total questions: 19
Worksheet time: 6mins
What does the action attribute in a
tag define?
Form method
CSS class
The URL where the form data is sent
JavaScript validator
Which HTTP method is commonly used to send data to the server?
GET
POST
PUT
DELETE
Which of these is a valid way to get an element in the DOM?
document.getElementById("demo")
window.alert("demo")
document.alertElement("demo")
getElement("demo")
What does JSON.stringify() do in JavaScript?
Parses a JSON string into an object
Converts an object to a JSON string
Validates JSON
Sends JSON to a server
Which PHP superglobal retrieves form data sent using POST?
$_GET
$_POST
$_FORM
$_INPUT
What is the correct way to define a function in JavaScript?
let function = () => {}
function myFunc() { }
def myFunc():
func myFunc()
What is the purpose of addEventListener() in JavaScript?
Adds a class to an element
Attaches a function to run when an event occurs
Changes element color
Binds HTML to CSS
What does innerText change in a DOM element?
Its ID
Its visible text
Its style
Its name attribute
In PHP, what does htmlspecialchars() protect against?
Cross-site scripting (XSS)
SQL injection
Cookie theft
Brute-force attacks
Which method is asynchronous in JavaScript?
fetch()
alert()
prompt()
parseInt()
What does the
Clears the form
Submits the form to the server
Styles the form
Uploads a file
Which of these is NOT a valid JSON value?
String
Object
Number
Function
What will typeof [1,2,3] return in JS?
object
array
list
JSON
Which method removes elements that don’t pass a test?
map()
forEach()
filter()
reduce()
What does setTimeout() do?
Runs code repeatedly
Runs code once after a delay
Cancels a function
Freezes the UI
Which language is primarily used to style web pages?
HTML
JavaScript
CSS
PHP
Which statement is used to output data in PHP?
printData()
echo
console.log
say()
What is a RESTful API?
A desktop application
A web service using HTTP and resources
A server's email service
A JavaScript framework
Which function gets the HTTP request type in PHP?
$_TYPE
$_SERVER["REQUEST_METHOD"]
$_HTTP
request.getMethod()
