Practice Test 2026 | Exam Prep | Accurate Answers | Instant
Download PDF
1. Images and shapes can be drawn in a canvas element by
using methods of the canvas element
calling methods of a drawing context obtained by calling the
getContext method of the canvas element
using SVG (Scalable Vector Graphics) elements nested inside the
canvas element
2. What is the accessibility principle and intent of SC 3.3.1 Error Identification?
Understandable, by ensuring users know if they have an error in a
form and where the error occurs.
Robust, by automatically substituting a correct value when users have
made an error.
Operable, by ensuring users cannot move forward to the next field
until the current field has a correct value.
Perceivable, by marking errors with red text.
3. Which statement will store data during the dragstart event?
e.dataTransfer.setData()
e.dragstart.setData()
e.setData()
e.drag.setData()
4. Describe the role of the getContext() method in the context of HTML5
canvas.
, The getContext() method is used to clear the canvas of any drawings.
The getContext() method provides access to the rendering context
and its drawing functions for creating graphics on the canvas.
The getContext() method sets the size of the canvas element.
The getContext() method initializes the canvas element for user input.
5. If you want to rotate an element around its bottom left corner instead of its
center, which CSS property would you adjust and how?
You would adjust the position property to 'absolute'.
You would adjust the transform-origin property to '0% 100%'.
You would adjust the transform property to 'rotate(45deg)'.
You would adjust the margin property to 'auto'.
6. What units are commonly used to define animation duration in CSS?
Hours or days
Percentage or viewport units
Seconds or milliseconds
Pixels or ems
7. Describe how CSS transformations can enhance the visual presentation of a
webpage.
CSS transformations are used solely for text formatting and do not
impact element positioning.
CSS transformations only change the color of elements without
affecting their layout.
, CSS transformations are limited to animations and do not alter the
appearance of static elements.
CSS transformations can enhance the visual presentation by
allowing elements to be scaled, skewed, or translated, creating
dynamic effects that improve user engagement.
8. What is the purpose of functions in JavaScript?
To avoid repetition of code
To separate different logical tasks in a program
To make code more maintainable
All of the above
9. If a user submits a form with invalid input, which combination of methods
would best inform them of the error?
Green borders and success messages
No feedback at all
Blue backgrounds and hints
Red borders and error messages
10. What is the purpose of event listeners in JavaScript?
To create animations on web pages.
To execute functions in response to user actions.
To store data temporarily.
To validate form inputs.
, 11. If you wanted to create a function in JavaScript that adds two numbers
together, which of the following would be the correct way to define it?
function addNumbers(a, b) { return a + b; }
function addNumbers { return a + b; }
function addNumbers(a, b) : return a + b;
addNumbers(a, b) => { return a + b; }
12. If a web developer is tasked with creating a mobile website for a restaurant,
which design consideration should they prioritize to improve user
interaction?
Desktop layout
High-resolution graphics
Extensive dropdown menus
Touch-friendly interfaces
13. Describe how event handling enhances user interaction in web applications.
Event handling is solely for debugging JavaScript code.
Event handling allows web applications to respond dynamically to
user actions, improving interactivity and user experience.
Event handling prevents users from submitting forms.
Event handling is used to style web pages with CSS.
14. What is the purpose of the CSS transform property?
To specify the font family for text
To control the size of an element