50 multiple-choice questions with answers and detailed explanations. Untimed — choose an answer to check it instantly.
0/50 answered0 correct
Question 1 of 50
Which HTML5 API allows users to drag items on a web page and move them to different positions or containers?
Correct answer: D) File API
Explanation: The Drag and Drop API enables users to drag elements across a web page, improving interactivity and usability.
Question 2 of 50
In CSS, which property is used to create a shadow effect inside the content area of an element?
Correct answer: B) box-shadow with inset
Explanation: The box-shadow property with the inset keyword creates an inner shadow within an element, adding depth to the content area.
Question 3 of 50
Which CSS property is used to define the width of an element’s border?
Correct answer: B) border-width
Explanation: The border-width property sets the thickness of an element’s border, allowing it to be adjusted for styling.
Question 4 of 50
Which JavaScript method is used to combine two or more arrays into a single array?
Correct answer: C) concat()
Explanation: concat() merges two or more arrays into a new array, preserving the original arrays and returning a combined result.
Question 5 of 50
What is the function of the transform-origin property in CSS3?
Correct answer: B) To define the point from which an element’s transformation occurs
Explanation: transform-origin determines the origin point for transformations, allowing elements to rotate, scale, or skew around a specific point.
Question 6 of 50
Which HTML5 form element allows users to select multiple options from a list?
Correct answer: A) <select multiple>
Explanation: Adding the multiple attribute to the <select> element lets users select multiple options from a dropdown list.
Question 7 of 50
In JavaScript, what method can be used to remove the last element from an array?
Correct answer: C) pop()
Explanation: pop() removes and returns the last element from an array, altering the array’s length.
Question 8 of 50
What is the primary purpose of the CSS clear property?
Correct answer: B) To prevent overlapping of floating elements
Explanation: The clear property ensures that floating elements do not overlap subsequent content, clearing space for other elements.
Question 9 of 50
Which HTML5 element is designed to include external applications or interactive content such as video, audio, or flash?
Correct answer: C) <object>
Explanation: The <object> element embeds external resources or applications like videos, Flash, or Java applets within a web page.
Question 10 of 50
In JavaScript, which method converts a JSON string into an object?
Correct answer: B) JSON.parse()
Explanation: JSON.parse() converts a JSON string into a JavaScript object, enabling data manipulation.
Question 11 of 50
Which CSS3 pseudo-class is used to select the last instance of a specified element within its parent container?
Correct answer: C) :last-of-type
Explanation: The :last-of-type pseudo-class targets the last occurrence of a specific element type within its parent container, regardless of the element's order among other types.
Question 12 of 50
Which HTML5 API can be used to control the browser history programmatically?
Correct answer: A) History API
Explanation: The History API allows developers to control the browser's navigation history, enabling back, forward, and specific page manipulations without reloading.
Question 13 of 50
In JavaScript, which array method removes the first element from an array and returns it?
Correct answer: B) shift()
Explanation: shift() removes the first element from an array and returns it, modifying the array’s length.
Question 14 of 50
What CSS property is used to apply a shadow effect to text characters?
Correct answer: D) text-shadow
Explanation: The text-shadow property adds a shadow effect to text characters, enhancing visual depth.
Question 15 of 50
Which HTML5 input type allows users to select only one option from a group?
Correct answer: C) radio
Explanation: The radio input type enables users to select only one option from a predefined group, ensuring mutual exclusivity.
Question 16 of 50
Which CSS property allows an element to appear visible only when its opacity value is greater than zero?
Correct answer: C) opacity
Explanation: The opacity property controls an element’s transparency, where values above zero make it visible and zero makes it fully transparent.
Question 17 of 50
In JavaScript, which keyword stops the execution of the current loop iteration and moves to the next iteration?
Correct answer: B) continue
Explanation: The continue keyword skips the current loop iteration and proceeds with the next iteration in the loop.
Question 18 of 50
Which CSS3 property is used to change the perspective of a 3D transformed element?
Correct answer: B) perspective
Explanation: The perspective property determines the depth effect for 3D-transformed elements, controlling how the view changes based on distance.
Question 19 of 50
In HTML5, which type provides a clickable link for users to initiate a phone call on mobile devices?
Correct answer: C) tel
Explanation: The tel input type creates a clickable link on mobile devices, allowing users to initiate a phone call directly.
Question 20 of 50
Which JavaScript function rounds a number to the nearest integer?
Correct answer: A) Math.round()
Explanation: Math.round() rounds a number to the nearest integer, rounding up if the decimal is .5 or higher.
Question 21 of 50
What is the purpose of the CSS cursor property?
Correct answer: B) To specify the mouse cursor appearance when hovering over an element
Explanation: The cursor property defines the appearance of the cursor when it hovers over specific elements, enhancing interactivity.
Question 22 of 50
Which HTML5 element is used for displaying interactive controls such as buttons, inputs, or form fields?
Correct answer: B) <fieldset>
Explanation: The <fieldset> element groups interactive controls and form fields for easier navigation and visual clarity.
Question 23 of 50
In JavaScript, which function should be used to delay the execution of code for a specified amount of time?
Correct answer: B) setTimeout()
Explanation: setTimeout() delays code execution by a specified amount of time, running the function once after the delay.
Question 24 of 50
What CSS property is used to add spacing between lines of text within a block?
Correct answer: B) line-height
Explanation: The line-height property controls the amount of space between lines, improving text readability and layout.
Question 25 of 50
Which JavaScript method would you use to convert an object into a JSON string for easy data transmission?
Correct answer: B) JSON.stringify()
Explanation: JSON.stringify() converts a JavaScript object into a JSON string, which is useful for sending data to a server or storing it as text.
Question 26 of 50
Which CSS property is used to define the thickness of an element’s border?
Correct answer: B) border-width
Explanation: The border-width property sets the thickness of an element’s border, allowing customization for styling purposes.
Question 27 of 50
In JavaScript, which method returns a string in all lowercase letters?
Correct answer: B) toUpperCase()
Explanation: The toLowerCase() method converts all characters in a string to lowercase.
Question 28 of 50
Which HTML5 element is best suited for grouping together multiple related elements in a form?
Correct answer: B) <fieldset>
Explanation: The <fieldset> element is used to group related form elements, enhancing structure and readability.
Question 29 of 50
What is the purpose of the CSS float property?
Correct answer: B) To center elements
Explanation: The float property allows elements, such as images, to align side by side within the flow of the document.
Question 30 of 50
In JavaScript, which keyword is used to define a block-scoped variable that can be reassigned?
Correct answer: C) let
Explanation: The let keyword defines a variable with block scope that can be reassigned, unlike const.
Question 31 of 50
What does the @media rule in CSS control?
Correct answer: C) Device-specific styles
Explanation: The @media rule applies styles based on device properties, enabling responsive design.
Question 32 of 50
Which HTML5 input type allows users to select a number by using a slider control?
Correct answer: A) range
Explanation: The range input type creates a slider, allowing users to choose a number within a defined range.
Question 33 of 50
Which JavaScript function is used to prompt the user with a question and capture their input?
Correct answer: D) prompt()
Explanation: The prompt() function displays a dialog box that prompts the user to enter input, returning their response as a string.
Question 34 of 50
Which CSS property is used to add space between the content and the border of an element?
Correct answer: B) padding
Explanation: The padding property provides space between an element’s content and its border, creating visual separation within the element.
Question 35 of 50
In HTML5, what is the purpose of the element?
Correct answer: C) To display the result of a calculation
Explanation: The element displays the result of calculations or other processed data within a form.
Question 36 of 50
Which CSS3 property allows elements to transition smoothly from one style to another when they change state?
Correct answer: C) transition
Explanation: The transition property enables smooth transitions between styles, such as color changes on hover.
Question 37 of 50
Which JavaScript array method adds a new element to the beginning of an array?
Correct answer: C) unshift()
Explanation: The unshift() method adds a new element to the beginning of an array, shifting all other elements forward.
Question 38 of 50
What does the display: inline-block property in CSS do?
Correct answer: B) Allows elements to set height and width while remaining inline
Explanation: display: inline-block gives block-level elements inline properties, allowing them to set dimensions without breaking to a new line.
Question 39 of 50
Which HTML5 attribute specifies that a form input field is required before submission?
Correct answer: C) required
Explanation: The required attribute forces users to complete a form field before submitting the form.
Question 40 of 50
In JavaScript, which keyword is used to terminate a loop prematurely?
Correct answer: C) break
Explanation: The break keyword exits a loop before it has completed all iterations, stopping further execution.
Question 41 of 50
Which CSS property allows developers to specify a shadow effect around the border of an element?
Correct answer: B) box-shadow
Explanation: box-shadow adds shadows around an element's border, allowing customization of color, blur, and offset.
Question 42 of 50
What is the purpose of the text-transform property in CSS?
Correct answer: C) To control capitalization of text
Explanation: The text-transform property adjusts text capitalization, allowing transformations to uppercase, lowercase, or capitalized.
Question 43 of 50
In JavaScript, which method is used to combine two or more strings?
Correct answer: B) join()
Explanation: The concat() method merges strings into a single string, creating a new combined result.
Question 44 of 50
Which CSS property should be used to define the background color of an element?
Correct answer: B) background-color
Explanation: The background-color property sets an element’s background color.
Question 45 of 50
Which HTML5 attribute of the element specifies the allowed character pattern?
Correct answer: D) pattern
Explanation: The pattern attribute uses regular expressions to validate an input field’s format, ensuring correct character entry.
Question 46 of 50
In CSS3, what does the border-radius property do?
Correct answer: B) Adds rounded corners to elements
Explanation: The border-radius property gives elements rounded corners, enhancing the visual style.
Question 47 of 50
Which JavaScript object represents the browser’s window?
Correct answer: C) window
Explanation: The window object represents the browser’s window, providing access to browser-specific functions and properties.
Question 48 of 50
What is the purpose of the visibility property in CSS?
Correct answer: B) To hide or show elements without removing them from layout
Explanation: The visibility property hides elements but maintains their layout space, unlike display: none.
Question 49 of 50
Which HTML5 attribute allows you to specify that multiple files can be selected in a file upload field?
Correct answer: D) pattern
Explanation: The multiple attribute enables users to select and upload multiple files simultaneously.
Question 50 of 50
In JavaScript, which method would you use to find the index of a specific element in an array?
Correct answer: B) indexOf()
Explanation: indexOf() returns the first index at which a specified element is found in an array, or -1 if it is not present.
Set 5 complete
You scored 0%
0 correct out of 0 answered (50 questions in this set).