"}},{"@type":"Question","name":"What is the hidden attribute, and how does its behavior differ from CSS display: none?","acceptedAnswer":{"@type":"Answer","text":"hidden is a boolean global attribute meaning the element is not currently relevant, so the browser doesn't render it. It's semantically richer than display: none but is implemented as a weak CSS default that styling can override. What hidden does: Removes the element from rendering and the accessibility tree, signaling intent (\"not relevant right now\"). The HTML5 hidden=\"until-found\" value keeps content findable via in-page search and reveals it. How it differs from display: none: hidden only applies the UA default display: none; any explicit display rule in CSS overrides it, leaving the element visible despite the attribute. It carries semantic meaning; display: none is purely presentational. Practical note: prefer hidden for relevance-based visibility, but be aware CSS can silently defeat it."}},{"@type":"Question","name":"What does the contenteditable global attribute do?","acceptedAnswer":{"@type":"Answer","text":"contenteditable is a global attribute that makes an element's content directly editable by the user in the browser, turning ordinary markup into an editable region. Values: true (or empty) makes it editable; false makes it non-editable; inherit follows the parent. How it behaves: Users can type, delete, and format text; the browser maintains the editing caret and selection. It's the foundation of rich-text editors (the WYSIWYG building block). Caveats: Edits change the live DOM, not a form value, so you read content via JS, not a name/form submission. Cross-browser behavior (generated markup, paste handling) is inconsistent, so production editors add heavy normalization."}},{"@type":"Question","name":"What does the translate global attribute do, and when would you use it?","acceptedAnswer":{"@type":"Answer","text":"translate is a global attribute that tells translation tools (browser translators, machine translation) whether an element's text content should be translated or left as-is. Values: yes (default, translatable) or no (leave untranslated); the setting is inherited by descendants. When to use translate=\"no\": Proper nouns: brand names, product names, and people's names that shouldn't change. Technical strings: code samples, commands, or literal values that must stay exact. It's a hint to translation engines, not enforced rendering, but well-behaved tools (including Google Translate) honor it.

The error was thrown by JSON.parse().

\n
Made by Acme Corp
"}},{"@type":"Question","name":"What is the purpose of the and elements, and how do they differ?","acceptedAnswer":{"@type":"Answer","text":"Both render a bar, but shows completion toward a goal (a task in motion), while shows a scalar measurement within a known range (a static gauge). : task completion: Uses value and max; represents how far along something is (file upload, loading). Omitting value gives an indeterminate state (unknown duration). : a measurement on a scale: Uses min, max, value, plus low, high, and optimum to color zones (good/warning). For a known fixed range: disk usage, score, temperature. Key distinction: progress changes over time toward 100%; a meter just reports a current reading. Don't use for progress or vice versa."}},{"@type":"Question","name":"What is the purpose of rel=\"noopener noreferrer\" when using target=\"_blank\" on a link?","acceptedAnswer":{"@type":"Answer","text":"These rel values protect security and privacy when a link opens a new tab with target=\"_blank\": noopener prevents the new page from controlling your page, and noreferrer withholds the referrer. noopener: closes a security hole: Without it, the opened page can access window.opener and redirect your original tab (a phishing vector called tabnabbing). It severs that reference so window.opener is null. noreferrer: privacy plus the same protection: Stops the browser sending the Referer header, hiding where the user came from. It also implies noopener behavior in modern browsers. Modern note: most current browsers now default target=\"_blank\" links to noopener automatically, but stating it explicitly is still best practice for older browsers and clarity."}},{"@type":"Question","name":"What is a 'skip link,' and why is it important for keyboard users?","acceptedAnswer":{"@type":"Answer","text":"A skip link is a hidden-until-focused link at the top of a page that jumps keyboard and screen reader users straight to the main content, letting them bypass repetitive navigation. What it is: Typically the first focusable element, e.g. Skip to content, pointing to the main content container. Why it matters: Keyboard users tab through the page in order; without it they must tab past every nav link on every page load. Required to meet WCAG 2.4.1 (Bypass Blocks). Implementation detail: Usually visually hidden but revealed :focus so sighted keyboard users can see it; the target should be focusable (add tabindex=\"-1\" if needed)."}},{"@type":"Question","name":"What is the rel='nofollow' attribute on a link, and when would you use it?","acceptedAnswer":{"@type":"Answer","text":"rel=\"nofollow\" tells search engines not to pass ranking credit (link equity) through a link and generally not to follow it for ranking purposes. What it signals: You don't endorse the target or don't want to vouch for it for SEO purposes. When to use it: User-generated content like comments and forums, where you can't vouch for posted links. Paid or sponsored links, to comply with search engine guidelines. Untrusted or low-quality links you must include. Related values: Google introduced more specific hints: rel=\"sponsored\" for paid links and rel=\"ugc\" for user-generated content."}},{"@type":"Question","name":"What does the novalidate attribute do on a form?","acceptedAnswer":{"@type":"Answer","text":"The novalidate attribute on a
tells the browser to skip native HTML5 constraint validation when the form is submitted, allowing it to submit even if fields fail rules like required or pattern. What it suppresses: The browser's automatic checks and built-in error bubbles on submit. When to use it: When you implement custom JavaScript validation and want full control over messaging. During testing/debugging to bypass validation quickly. Related: the formnovalidate attribute on a submit button skips validation for that one submit action only. Note: it does not disable the Constraint Validation API, so you can still call checkValidity() manually."}},{"@type":"Question","name":"Explain how native HTML5 validation works using attributes like required, pattern, and type=\"email\".","acceptedAnswer":{"@type":"Answer","text":"Native HTML5 validation uses declarative constraint attributes on inputs; on submit the browser checks each field against its constraints, blocks submission if any are invalid, and shows a built-in error message, all without JavaScript. Key constraint attributes: required: field must not be empty. type=\"email\"/type=\"url\": value must match the expected format. pattern: value must match a regular expression. min, max, minlength, maxlength, step: numeric and length bounds. How it surfaces: CSS pseudo-classes :valid, :invalid, :required style fields by state. The Constraint Validation API (checkValidity(), setCustomValidity(), validity) lets you read state and set custom messages. Limits: client validation is for UX only and can be bypassed, so always re-validate on the server. \n"}},{"@type":"Question","name":"What is the purpose of the datalist element, and how does it differ from a standard select dropdown?","acceptedAnswer":{"@type":"Answer","text":"The element provides a list of suggested values for a free-text , combining autocomplete hints with the ability to type any value, whereas a \n\n "}},{"@type":"Question","name":"What do the placeholder, autocomplete, and maxlength attributes do on form inputs, and why isn't placeholder a substitute for a label?","acceptedAnswer":{"@type":"Answer","text":"These attributes guide input but serve different jobs: placeholder shows hint text, autocomplete controls browser autofill, and maxlength caps the number of characters. A placeholder cannot replace a label because it disappears on input and is unreliable for accessibility. placeholder: Faint example/hint text shown only while the field is empty. autocomplete: Tells the browser whether/how to autofill; use tokens like email, name, off for better autofill or to disable it. maxlength: Hard limit on character count entered; pair with minlength for a floor. Why placeholder ≠ label: It vanishes once typing starts, removing context and hurting users with memory or cognitive needs. Screen-reader support is inconsistent, and low contrast fails readability. A real