Exam Questions & 100% Correct Answers | Latest
Update 2026 | Exam Prep
1. What is the purpose of the maxlength attribute in HTML input fields?
Defines the default value of the input field.
Indicates the type of data that can be entered.
Specifies the maximum number of characters that can be entered.
Sets the minimum number of characters required.
2. If a web developer wants to ensure that users can easily select a date in a
form, which input type should they implement and why?
They should implement a number input to specify the day of the
month.
They should implement the HTML5 input type 'date' because it
provides a user-friendly calendar interface for date selection.
They should implement a text input field to allow for free-form date
entry.
They should implement a checkbox input to select dates.
3. If you want to draw a rectangle on a canvas, which of the following code
snippets correctly utilizes the canvas.getContext("2d") method?
const ctx = canvas.getContext(); ctx.fillRect(10, 10, 100, 50);
const ctx = canvas.getContext("3d"); ctx.fillRect(10, 10, 100, 50);
const ctx = canvas.getContext("2d"); ctx.drawRectangle(10, 10, 100, 50);
, const ctx = canvas.getContext("2d"); ctx.fillRect(10, 10, 100, 50);
4. Describe the effect of using the jQuery empty() method on a DOM element.
The empty() method removes the selected element and all its children
from the DOM.
The empty() method only changes the attributes of the selected
element.
The empty() method clears all child elements from the selected
element while keeping the element itself intact.
The empty() method adds new child elements to the selected
element.
5. In a web application, if a user inputs numbers into two fields and clicks a
button to calculate their sum, which HTML5 element would you use to
display the result of this calculation?
button
textarea
output
input
6. Describe how the 'clear' property affects the layout of elements in CSS.
The 'clear' property modifies the display type of an element.
The 'clear' property changes the text alignment of an element.
The 'clear' property increases the padding of an element.
The 'clear' property prevents floating elements from affecting the
positioning of subsequent elements.
7. The CSS3 _____________ property provides for changes in property values to
display in a smoother manner over a specified time.
, hover
transition
display
transform
8. What is the primary function of the manifest file in an Offline web app?
To define the layout of the web app.
To manage the caching of the web app resources.
To store user data locally.
To handle user authentication.
9. Describe the role of the keytype attribute in the context of a keygen form
element.
The keytype attribute specifies the user interface for key generation.
The keytype attribute defines the acceptable types of keys that can
be generated by the keygen element.
The keytype attribute sets the default key length for the keygen.
The keytype attribute determines the security level of the key
generated.
10. Which method is used to clear the watch process and stop monitoring the
user's location changes with the Geolocation API?
navigator.geolocation.endWatch()
navigator.geolocation.removeWatch()
navigator.geolocation.clearWatch()
navigator.geolocation.stopTracking()
, 11. What is the purpose of the CSS @keyframes rule?
To add visual effects to an element
To specify the background color of an element
To control the positioning of an element
To define a CSS animation
12. Describe the significance of the method canvas.getContext("2d") in web
development.
The method canvas.getContext("2d") retrieves the 3D context for
rendering graphics.
The method canvas.getContext("2d") is used to create audio contexts
in web applications.
The method canvas.getContext("2d") is used to manipulate HTML
elements directly.
The method canvas.getContext("2d") is essential for drawing 2D
graphics on the canvas element in web applications.
13. What is the purpose of the CSS3 UI property 'resize'?
It determines the color of an element's border.
It sets the font size of text within an element.
It controls the visibility of an element on the page.
It specifies whether an element can be resized by the user and how
it can be resized.
14. Describe the rules for naming variables in JavaScript, particularly focusing
on the characters allowed after the first character.
After the first character, a JavaScript variable name can include