Question 1 of 50
Which CSS3 property is used to create a transition effect between two styles when a user hovers over an element?
Correct answer:
C) transition
Explanation: The transition property allows smooth changes between two styles on user-triggered events, such as hovering.
Question 2 of 50
In JavaScript, which method is used to round a number down to the nearest integer?
Correct answer:
C) Math.floor()
Explanation: Math.floor() rounds a number down to the nearest integer, regardless of its decimal portion.
Question 3 of 50
Which HTML5 input type is used to let users select a date and time with a local timezone?
Correct answer:
B) time
Explanation: datetime-local allows users to select a date and time in the browser's local timezone without specifying a time zone offset.
Question 4 of 50
What CSS property can you use to prevent an image from exceeding the screen width on mobile devices?
Correct answer:
A) max-width: 100%
Explanation: Setting max-width: 100% ensures the image scales down to fit the screen width, preventing overflow on mobile.
Question 5 of 50
Which JavaScript method is used to remove an event listener that was added with addEventListener()?
Correct answer:
B) removeEventListener()
Explanation: removeEventListener() removes a specified event listener, stopping it from responding to future events.
Question 6 of 50
Which attribute of the <textarea> element allows users to resize the input area?
Correct answer:
D) resize
Explanation: The resize attribute, when set in CSS, enables or disables the ability to resize a <textarea> vertically, horizontally, or both.
Question 7 of 50
What CSS property is used to add space between characters in text?
Correct answer:
B) letter-spacing
Explanation: letter-spacing adjusts the spacing between individual characters within a block of text.
Question 8 of 50
Which HTML5 attribute is used to specify a pattern that an <input> element’s value must match for form validation?
Correct answer:
C) pattern
Explanation: The pattern attribute uses regular expressions to enforce a specific format on the input’s value for validation.
Question 9 of 50
In JavaScript, which keyword is used to declare a constant that cannot be reassigned?
Correct answer:
C) const
Explanation: const is used to declare variables that cannot be reassigned, maintaining constant values throughout the script.
Question 10 of 50
What CSS3 property allows elements to transform on a 3D plane, rotating them around the x, y, or z-axis?
Correct answer:
B) transform
Explanation: The transform property allows both 2D and 3D transformations, including rotations along the x, y, and z axes.
Question 11 of 50
Which HTML5 API provides access to the geographic location of the user’s device?
Correct answer:
A) Geolocation API
Explanation: The Geolocation API retrieves the geographic location of a user's device, enabling location-based services.
Question 12 of 50
What is the purpose of the float property in CSS?
Correct answer:
B) To position elements side by side
Explanation: The float property positions elements like images to the left or right, allowing surrounding content to wrap around them.
Question 13 of 50
Which CSS3 property is used to create an animation by specifying multiple steps?
Correct answer:
C) keyframes
Explanation: The @keyframes rule defines an animation by specifying the styles at various stages of the animation sequence.
Question 14 of 50
In JavaScript, what is the correct syntax to call a function named myFunction?
Correct answer:
B) myFunction();
Explanation: Using myFunction(); correctly calls the function, executing the statements inside myFunction.
Question 15 of 50
Which HTML5 input type allows users to enter a number by sliding a control left or right within a specified range?
Correct answer:
C) range
Explanation: The range input type creates a slider control that lets users select a value within a specified numeric range by sliding left or right.
Question 16 of 50
Which JavaScript method is used to stop an ongoing setInterval() call?
Correct answer:
B) clearInterval()
Explanation: clearInterval() stops the execution of code set by setInterval() by clearing the interval.
Question 17 of 50
What CSS property specifies whether a background image should repeat, and in which direction?
Correct answer:
B) background-repeat
Explanation: background-repeat specifies if and how a background image should repeat horizontally, vertically, or not at all.
Question 18 of 50
Which HTML5 element is used to display multiple lines of text input from the user?
Correct answer:
B) <textarea>
Explanation: The <textarea> element is designed for multi-line text input, unlike <input type="text">, which is limited to single-line input.
Question 19 of 50
What is the purpose of the CSS box-sizing property?
Correct answer:
B) To include padding and border within an element's width and height
Explanation: The box-sizing property adjusts how an element’s width and height are calculated, including padding and borders in the dimensions.
Question 20 of 50
Which HTML5 attribute is used to specify that a <video> should begin playing automatically upon page load?
Correct answer:
C) autoplay
Explanation: The autoplay attribute causes the <video> to start playing as soon as the page loads without user input.
Question 21 of 50
In JavaScript, which function converts a string to an integer?
Correct answer:
B) parseInt()
Explanation: parseInt() converts a string to an integer, parsing it until it encounters a non-numeric character.
Question 22 of 50
Which CSS property is used to create space between the border and content of an element?
Correct answer:
B) padding
Explanation: The padding property provides space between an element's content and its border, within the box model.
Question 23 of 50
What is the primary function of the HTML element?
Correct answer:
B) To create a multi-line text input
Explanation: The element creates a dropdown list, allowing users to choose one option from multiple choices.
Question 24 of 50
Which HTML5 attribute specifies a text hint that appears in an field until the user enters a value?
Correct answer:
B) required
Explanation: The placeholder attribute provides a hint about the expected input, displayed until the user types in the field.
Question 25 of 50
Which JavaScript event is triggered when the user removes focus from an input field?
Correct answer:
B) focus
Explanation: The blur event is triggered when an element loses focus, often used in form validation.
Question 26 of 50
What does the CSS background-position property control?
Correct answer:
B) The color of the background
Explanation: The background-position property sets the initial position of a background image within its container.
Question 27 of 50
In JavaScript, which event handler is used to execute code when a user selects the text in a form field?
Correct answer:
B) onfocus
Explanation: The onselect event is triggered when the user selects text in a form field, useful for actions like copy or validation prompts.
Question 28 of 50
Which CSS property specifies the amount of space between words within a text block?
Correct answer:
B) text-align
Explanation: word-spacing adjusts the space between words, affecting text readability and layout.
Question 29 of 50
What is the primary function of the HTML5 element?
Correct answer:
B) To display a progress bar
Explanation: The element visually represents the completion progress of a task, such as file upload or process status.
Question 30 of 50
Which CSS property is used to control the visibility of an element’s back face when it is rotated in 3D space?
Correct answer:
B) perspective
Explanation: backface-visibility determines whether an element’s reverse side is visible when it is rotated in 3D space.
Question 31 of 50
In HTML5, which attribute is used to bind a <label> to a specific form field?
Correct answer:
C) for
Explanation: The for attribute in <label> links it to a specific form field by matching the field’s id, enhancing accessibility.
Question 32 of 50
Which JavaScript operator is used to check for equality of both value and type between two expressions?
Correct answer:
B) ===
Explanation: The strict equality operator === checks if both value and type are identical between two expressions.
Question 33 of 50
Which CSS property sets the maximum width an element can expand to?
Correct answer:
C) max-width
Explanation: max-width defines the maximum width an element can occupy, restricting it from expanding beyond that value.
Question 34 of 50
What is the purpose of the onclick event in JavaScript?
Correct answer:
B) To execute code when an element is clicked
Explanation: onclick is triggered when the user clicks on an element, commonly used for interactive features.
Question 35 of 50
Which HTML5 API can store data that persists across page reloads?
Correct answer:
B) Local Storage
Explanation: Local Storage stores data persistently on the client-side, even after the page is reloaded or the browser is closed.
Question 36 of 50
Which CSS property controls the display of text overflowing beyond the container’s boundary?
Correct answer:
A) text-overflow
Explanation: text-overflow determines how to handle text that overflows a container, often using an ellipsis to indicate clipping.
Question 37 of 50
Which CSS property should be used to create a box with rounded corners?
Correct answer:
B) border-radius
Explanation: The border-radius property rounds the corners of an element, improving visual style and creating softer edges.
Question 38 of 50
In JavaScript, which statement is correct for checking if two variables, a and b, are not equal in both value and type?
Correct answer:
B) a !== b
Explanation: The strict inequality operator !== checks for inequality in both value and type between two expressions.
Question 39 of 50
Which HTML5 input attribute provides a real-time example of user input without enforcing a specific format?
Correct answer:
A) placeholder
Explanation: The placeholder attribute displays sample text in an <input> field, providing guidance on expected input.
Question 40 of 50
What is the function of the @media rule in CSS?
Correct answer:
C) To apply styles based on device characteristics
Explanation: The @media rule applies different styles according to the device’s properties, like screen width, enhancing responsiveness.
Question 41 of 50
Which CSS property can be used to adjust the level of transparency on an element?
Correct answer:
A) opacity
Explanation: The opacity property controls an element’s transparency, with values from 0 (fully transparent) to 1 (fully opaque).
Question 42 of 50
In HTML5 forms, which attribute makes an input field mandatory before form submission?
Correct answer:
B) required
Explanation: The required attribute ensures that users fill out an input field before submitting the form.
Question 43 of 50
Which JavaScript function pauses execution for a specified number of milliseconds?
Correct answer:
B) setTimeout()
Explanation: setTimeout() delays the execution of a function by a specified number of milliseconds before running it once.
Question 44 of 50
What is the purpose of the CSS z-index property?
Correct answer:
A) To control the order of stacking elements
Explanation: The z-index property sets the stack order of positioned elements, with higher values appearing in front.
Question 45 of 50
Which HTML5 input type is best suited for entering a numeric value with up and down controls?
Correct answer:
C) number
Explanation: The number input type provides up and down controls for numeric values, simplifying data entry.
Question 46 of 50
Which JavaScript method is used to display an alert box with a message and an OK button?
Correct answer:
A) alert()
Explanation: The alert() method shows a simple dialog box with a message and an OK button for acknowledgment.
Question 47 of 50
Which CSS property defines how an element's content wraps when it reaches the end of a line?
Correct answer:
A) word-wrap
Explanation: The word-wrap property enables long words or text to break onto the next line, preventing overflow.
Question 48 of 50
What is the purpose of the element in HTML5 forms?
Correct answer:
C) To group related form elements
Explanation: The element organizes related form fields, improving readability and form structure.
Question 49 of 50
In JavaScript, which keyword is used to declare a variable with block scope, similar to const but allowing reassignment?
Correct answer:
B) let
Explanation: The let keyword declares a block-scoped variable that can be reassigned, offering flexibility within the block.
Question 50 of 50
Which HTML5 attribute prevents text from wrapping within an field, allowing only a single line of text?
Correct answer:
A) nowrap
Explanation: The nowrap attribute or CSS white-space: nowrap prevents text from breaking to a new line, keeping it in a single line within the field.
Set 4 completeYou scored 0%
0 correct out of 0 answered (50 questions in this set).