What does the following code create?
<input type="password" name="pass">Read the full question →HTML is the document layer of the web. Getting it right is most of accessibility and a surprising amount of SEO.
Semantic element choice, form and label association, the accessibility tree, parser quirks around nesting, and how script loading attributes change execution order.
Where it shows up: Every frontend role, plus email, content and accessibility-focused engineering work.
Twenty real HTML questions from the library, code snippet included. Nothing here is paraphrased for search engines. It is the same text a signed-in user sees.
<input type="password" name="pass">Read the full question →<button type="button">Click Me</button>Read the full question →<p>This is <em>emphasized</em> text.</p>Read the full question →<p>This is <b>bold</b> text.</p>Read the full question →<ul>\n <li>Item 1</li>\n <li>Item 2</li>\n</ul>Read the full question →<ul>\n <li>Item 1</li>\n <li>Item 2\n <ul>\n <li>Subitem</li>\n </ul>\n </li>\n</ul>Read the full question →<blockquote>\n <p>This is a quote.</p>\n</blockquote>Read the full question →<table>\n <thead>\n <tr><th>Header</th></tr>\n </thead>\n <tbody>\n <tr><td>Data</td></tr>\n </tbody>\n</table>Read the full question →<label for="f">Native label</label>
<input id="f" type="text"
aria-labelledby="a b" aria-label="aria label"
title="the title" placeholder="type here">
<span id="a">First</span><span id="b">Second</span>Read the full question →<p>Hello
world</p>Read the full question →<fieldset>
<legend>Shipping speed</legend>
<label><input type="radio" name="s" value="std"> Standard</label>
<label><input type="radio" name="s" value="exp"> Express</label>
</fieldset>Read the full question →<video controls>
<source src="clip.mp4" type="video/mp4">
<track kind="subtitles" src="en.vtt" srclang="en" label="English" default>
<track kind="captions" src="en-cc.vtt" srclang="en" label="English CC">
</video>Read the full question →<fieldset disabled>
<legend><button>Toggle</button></legend>
<input name="a">
<input name="b">
</fieldset>Read the full question →class XInput extends HTMLElement {
static formAssociated = true;
#internals = this.attachInternals();
}Read the full question →el.getHTML({ serializableShadowRoots: true, shadowRoots: [closedRoot] });Read the full question →<input type="range" min="0" max="10">Read the full question →<input pattern="[A-Z]{2}\d{4}" title="Two letters then four digits">Read the full question →<input list="colors" name="c">
<datalist id="colors">
<option value="Red">
<option value="Green">
</datalist>Read the full question →<head>
<title>Demo</title>
<p>Loading...</p>
</head>Read the full question →const cfg = { attrs: ['a'] };
class Base extends HTMLElement {
static get observedAttributes(){ return cfg.attrs; }
attributeChangedCallback(n){ console.log('base', n); }
}
customElements.define('x-base', Base);
cfg.attrs = ['a', 'b'];
class Sub extends Base {} // no own observedAttributes
customElements.define('x-sub', Sub);Read the full question →We keep the correct answer, the explanation and the scoring behind sign-in so the platform stays honest, which is why the answer options and the worked explanation for every HTML question stay behind a free account. Signing in is free and takes a few seconds.
46 distinct HTML topics are tagged across the library. These are the real topic labels stored on the questions, not a hand-written list.
…