Exam Questions & 100% Correct Answers | Latest Update
2026 | Exam Prep
1. If a web developer is tasked with creating a website that must function well on
both desktop and mobile devices, which approach should they prioritize?
Responsive design
Creating separate mobile and desktop versions
Using only CSS for layout
Implementing a fixed layout for all devices
2. What method is commonly used in JavaScript to prompt the user for input?
confirm()
console.log()
prompt()
alert()
3. What occurs when you specify a background-size property value of contain?
The background image is scaled to the largest size possible that
completely overlays the background area of the parent container
while maintaining aspect ratio of the image.
The background image is repeated as many times as necessary to
completely overlay the background area of the parent container.
The background image's width and height values are converted to em
units.
, The background image is scaled to the largest size possible that
allows both width and height to fit within the specified content area.
4. What can client-side JavaScript be used for?
To interact with other programs, control the operating system, and
dynamically create standalone content.
To interact with hardware, control devices, and dynamically create
embedded content.
To interact with the user, control the browser, and dynamically
create HTML content.
To interact with the server, control the database, and dynamically
create server-side content.
5. Describe the role of the 'action' attribute in an HTML form.
The 'action' attribute sets the target for the form's response.
The 'action' attribute defines the type of data being submitted.
The 'action' attribute specifies the URL where the form data should
be sent for processing.
The 'action' attribute determines the method of data submission.
6. In regards to the CSS box model, where is the margin property located?
None of the above
inside or outside depending on where you put it in your code
Outside the box
Inside the box
7. A teacher is writing a code segment that will use variables to represent a
student's name and whether or not the student is currently absent. Which of
the following variables are most appropriate for the code segment?
, A string variable named studentName and a Boolean variable
isAbsent
A string variable named studentName and a numeric variable named
numAbsences
A string variable named s and a Boolean variable named a
A string variable named s and a number variable named n
8. What are native HTML form elements?
Custom JavaScript objects designed for form handling.
CSS styles applied to enhance form appearance.
Standard HTML elements like <input>, <select>, and <textarea> used
for form creation.
Third-party libraries that simplify form validation.
9. Which History API method changes the URL in the browser window by
adding a URL to the history stack?
history.pushState()
history.replaceState()
history.pullState()
history.changeState()
10. In order to add drag-and-drop functionality to your Web pages, you must
define an element as able to be dragged by:
setting its draggable attribute to the value "on".
setting its draggable attribute to the value "yes".
setting its draggable attribute to the value "drag".
, setting its draggable attribute to the value "true".
11. Given a scenario where you need to create a user profile in JavaScript, which
data type would you use to encapsulate the user's information and
functionalities, and why?
Array
String
Function
Object
12. Why is immediate feedback important when validating forms?
Immediate feedback is not necessary for form validation
Immediate feedback can confuse the user with too much information
Immediate feedback only benefits the server
Giving the user immediate feedback helps them resolve issues
faster
13. Describe how the <keygen> element enhances security in web forms.
The <keygen> element enhances security by validating user input
before submission.
The <keygen> element enhances security by allowing the
generation of a public/private key pair, which can be used for
secure data transmission.
The <keygen> element enhances security by providing a user-friendly
interface for form submission.
The <keygen> element enhances security by encrypting form data on
the client side.