What does HTML stand for
- HyperText Markup Language.
Which HTML tag is used for the main heading of a page
- h1.
Which tag is used to create a hyperlink
- a.
How do you include an external CSS file in HTML
- link rel="stylesheet" href="styles.css".
Which HTML attribute specifies alternative text for an image
- alt.
Which tag is used to create an unordered list
- ul.
What does CSS stand for
- Cascading Style Sheets.
Which property controls the text color in CSS
- color.
How do you select an element with id "main" in CSS
- #main.
How do you select elements with class "btn" in CSS
- .btn.
Which CSS property is used to change the font size
- font-size.
Which CSS property controls the space between an element's border and its content
- padding.
Which CSS property controls the space outside an element's border
- margin.
What is the default display value of a div element
- block.
Which CSS property changes the background color of an element
- background-color.
Which HTML element is used to embed JavaScript code
- script.
How do you write a comment in JavaScript
- // comment.
Which method prints a message to the browser console
- console.log().
How do you declare a variable that cannot be reassigned in JavaScript
- const.
Which keyword declares a block-scoped variable in JavaScript
- let.
What is the result of typeof [] in JavaScript
- object.
Which method converts a JavaScript object to a JSON string
- JSON.stringify().
Which method parses a JSON string into a JavaScript object
- JSON.parse().
What does DOM stand for
- Document Object Model.
Which method selects the first element that matches a CSS selector
- document.querySelector().
Which method selects an element by its id
- document.getElementById().
How do you add a CSS class "active" to an element in JavaScript
- element.classList.add('active').
Which event fires when the user clicks an element
- click.
How do you prevent the default action of an event in JavaScript
- event.preventDefault().
Which attribute loads a script without blocking HTML parsing but executes it as soon as it's ready
- async.
Which attribute ensures a script executes after the HTML is parsed
- defer.
What does CSS box-sizing: border-box do
- Includes padding and border in the element's total width and height.
Which CSS property is used for flexible box layout
- display: flex.
Which CSS property aligns items along the main axis in flexbox
- justify-content.
Which CSS property aligns items along the cross axis in flexbox
- align-items.
What CSS property defines a grid container
- display: grid.
Which unit is relative to the root element's font size
- rem.
Which CSS pseudo-class represents an element when a user mouses over it
- :hover.
Which CSS pseudo-element inserts content before an element's content
- ::before.
Which property makes an element invisible but still takes up space
- visibility: hidden.
Which property makes an element not appear and not take any space
- display: none.
What does the CSS z-index property control
- Stacking order along the z-axis.
Which HTML5 element is used for scalable vector graphics
- svg.
Which input type provides a date picker in supporting browsers
- type="date".
How do you make an element focusable for accessibility
- Add tabindex="0".
Which HTML meta tag sets the character encoding
- meta charset="utf-8".
Which JavaScript operator is used for strict equality comparison
- ===.
What does hoisting in JavaScript refer to
- Declarations being moved to the top of their scope at runtime.
Which method adds an element as the last child of a parent node
- parent.appendChild(child).
What is event delegation
- Using a single handler on a parent to manage events for its children.
Which keyword creates a class in JavaScript
- class.
Which method removes an element from the DOM
- element.remove().
What does CSS specificity determine
- Which CSS rule applies when multiple rules target the same element.
Which property smoothly changes property values over time in CSS
- transition.
Which property creates keyframe-based animations in CSS
- animation.
Which HTML attribute is used to store custom data on elements
- data-* attributes.
How do you comment in CSS
- /* comment */.
Which JavaScript feature allows asynchronous code written like synchronous code using async/await
- Promises with async/await.
What does the fetch() function return
- A Promise.
Which HTTP method is commonly used to retrieve data
- GET.
Which HTML element is used to create a form
- form.
Which input attribute makes a field required before submitting a form
- required.
Which attribute specifies where to open the linked document for an a tag
- target.
What does the CSS property object-fit control
- How replaced content like images fit within their container.
Which JavaScript array method creates a new array with results of calling a function on every element
- map().
Which array method creates a new array with elements that pass a test
- filter().
Which array method reduces array to a single value
- reduce().
What do CSS media queries help with
- Applying styles based on device characteristics like width.
Which property makes text unselectable by user
- user-select: none.
Which HTML element defines the document's title shown in browser tab
- title.
Which tag is used to include inline SVG code
- svg.
Which HTML attribute specifies the URL of an image
- src.
Which CSS function calculates values using expressions
- calc().
Which CSS variable syntax defines a custom property
- --var-name: value;
How do you use a CSS custom property in a rule
- var(--var-name).
Which HTML element is used to embed a video
- video.
Which attribute on video enables native controls
- controls.
Which JavaScript statement handles runtime errors
- try...catch.
Which method stops event propagation to parent elements
- event.stopPropagation().
Which property sets the font family in CSS
- font-family.
Which unit is relative to the viewport height
- vh.
What does the HTML5 canvas element provide
- A drawable region for graphics via script.
Which attribute on input masks user input for passwords
- type="password".
Which HTTP status code indicates success
- 200.
Which status code indicates a resource was not found
- 404.
Which meta tag helps responsive design by controlling viewport
- meta name="viewport" content="width=device-width, initial-scale=1".
Which HTML element is for self-contained content like articles
- article.
Which is a semantic HTML element used for site navigation
- nav.
Which CSS shorthand sets top, right, bottom, left margins
- margin.
Which JavaScript function delays code execution by a specified time
- setTimeout().
Which function repeats execution at a set interval
- setInterval().
How do you stop an interval set by setInterval
- clearInterval(intervalId).
Which attribute makes an input not editable
- readonly.
Which attribute disables an input and prevents interaction
- disabled.
Which CSS property controls how content overflows an element
- overflow.
Which method replaces an element's HTML content securely as text
- textContent.
Which property returns or sets the HTML inside an element
- innerHTML.
Which JavaScript concept allows functions to access variables from their outer scope
- Closure.
Which operator is used to create a template literal in JavaScript
- Backticks.
Which CSS property flips or moves an element in 2D/3D space
- transform.
Which method adds HTML before an element's first child
- parent.insertBefore(newNode, parent.firstChild).
Which property sets how text wraps inside an element
- white-space.
Which JavaScript keyword creates a promise explicitly
- new Promise().
Which CSS property creates rounded corners on elements
- border-radius.
Which attribute tells the browser where to find the favicon
- link rel="icon" href="favicon.ico".
Which method prevents a form from submitting and allows custom handling
- event.preventDefault().
Which CSS property controls element opacity
- opacity.
Which HTML element is used for emphasized text
- em.
Which HTML element indicates important text
- strong.
Which JavaScript method copies a portion of an array to a new array without modifying the original
- slice().
Which method changes an array by removing or replacing existing elements
- splice().
Which CSS rule targets elements with attribute type="text"
- input[type="text"].
Which HTML element is used to provide a caption for a table
- caption.
Which CSS property defines the font weight
- font-weight.
Which attribute specifies an element's role for accessibility
- role.
Which API allows storing key-value pairs in the browser persistently
- localStorage.
Which API stores data only for the session and clears it on tab close
- sessionStorage.
Which method removes a key from localStorage
- localStorage.removeItem(key).
Which HTML element is intended for side content like a sidebar
- aside.
Which CSS property affects only the first line of an element
- ::first-line pseudo-element.
What is the purpose of semantic HTML
- To convey meaning and structure to browsers and assistive technologies.
Which attribute on script prevents the browser from executing the script immediately when parsing
- defer.
Which CSS property sets the number of columns for multi-column layout
- column-count.
Which CSS function limits a value between a minimum and maximum
- clamp().
Which JavaScript method finds the index of the first element that passes a test
- findIndex().
Which HTML element is used to group form controls and labels
- fieldset.
Which attribute associates a label with a form control
- for.
Which CSS property sets a background image on an element
- background-image.
Which property changes the order of flex items without changing the DOM
- order.
Which HTML element is used to define a block of preformatted text
- pre.
Which CSS property specifies how long an animation takes to complete one cycle
- animation-duration.
Which JavaScript method merges two or more arrays into a new array
- concat().
Which CSS property allows smooth scrolling behavior for in-page links
- scroll-behavior.
Which HTML attribute indicates the language of the document
- lang.
Which CSS rule applies styles to screens narrower than 600px
- @media (max-width: 600px).
Which JavaScript property returns the length of an array
- array.length.
Which HTML attribute specifies an input's placeholder text
- placeholder.
Which CSS property sets element positioning context for absolute children
- position: relative.
Which position value fixes an element relative to the viewport
- fixed.
Which CSS property creates spacing between flex items
- gap.
Which HTML element is used to embed audio
- audio.
Which attribute allows cross-origin requests in script or link elements
- crossorigin.
Which JavaScript property returns the viewport width
- window.innerWidth.
Which CSS property sets whether an element floats to the left or right
- float.
Which HTML element is used to define a generic inline container for phrasing content
- span.
Which HTML element is used to create a clickable button
- button.
Which CSS property sets the transition timing function (e.g., ease, linear)
- transition-timing-function.
Which JavaScript method clones a node and its subtree
- node.cloneNode(true).
Which attribute on img enables lazy loading in supporting browsers
- loading="lazy".
Which CSS property enables text truncation with an ellipsis
- text-overflow: ellipsis.
Which HTML element is used to embed external content like an iframe
- iframe.