JavaScriptHTMLIFrameElement represents an embedded frame. Its contentWindow property exposes the frame's window, while load lets you react when loading finishes. Document access depends on the same-origin policy, and load alone does not confirm a successful fetch.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLImageElement.alt reads and sets an image's text replacement. The property reflects the alt attribute; an empty string and a missing attribute do not mean the same thing.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLImageElement lets you set an image source and alternative text, handle load and error events, and read natural dimensions. The complete property does not prove success: it is also true for a broken image or an element without a source.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLImageElement.src reads or sets an image URL. It reflects the src attribute. Reading it returns an absolute URL only if the attribute value parses successfully using the document's base URL. It does not confirm that the image has loaded.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe checkValidity() method checks the constraints of one input and returns a boolean. For an invalid input that participates in validation, it fires invalid but does not itself display an error message.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptLearn six HTMLInputElement properties for choosing an input type, reading checked state, setting constraints, and disabling a control. Distinguish current state from initial attributes and a validation message from the validation result itself.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLInputElement.setCustomValidity sets or clears a form field's custom error. An empty string clears that error without disabling other constraints.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLInputElement.validity exposes an input's current constraint-validation state as a ValidityState object. Its flags identify particular problems, while valid indicates that no error flag is set.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLInputElement.value reads or sets a value as a string. Its behavior depends on type; for a text input, the current value can differ from the default value.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptRead and write an input's numeric value. Recognize NaN and remember that conversion depends on the input type.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLMediaElement supplies the shared API for audio and video elements. Read playback state, change position and muting, and update the interface from events rather than assuming a playback command succeeded immediately.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe pause() method pauses an audio or video element without rewinding it. It takes no arguments and returns undefined. The paused state changes synchronously, whereas the pause event is dispatched later.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe play() method requests that audio or video playback start or resume. It returns a Promise, so the interface should account for both playback starting and the request being rejected.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLOptionElement represents an option element. Its value property returns the value of the value attribute if present, or a value derived from the option's text if the attribute is absent. The current selection state does not affect the result.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLProgressElement exposes the max and value properties of a progress element. They describe the total amount of work and the completed portion, while distinguishing known zero progress from a state where the completion level is unknown.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptscript defer lets an external classic script download alongside HTML parsing. Execution happens after parsing finishes and before the DOMContentLoaded event.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSetting `type="module"` marks the script as a module script. Inline code is treated as a JavaScript module. The HTML Standard also allows `src` to reference a WebAssembly entry module, but browser support varies. JavaScript modules support `import` and `export`, run in strict mode automatically, and have their own scope for declarations.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLSelectElement.value reads the first selected option's value or changes the selection by matching a value.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLTemplateElement stores template content in a separate DocumentFragment exposed through content. The content is not rendered inside the template; copy it with document.importNode() and insert it into the document without consuming the original.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLTextAreaElement.selectionEnd reads or sets the ending boundary of a textarea selection. It is a zero-based offset measured in UTF-16 code units; the ending position is excluded from the selection.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptHTMLTextAreaElement.selectionStart reads or sets the selection's start in a textarea. Its zero-based offset counts UTF-16 code units rather than visible characters.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScript`HTMLTextAreaElement.value` reads or sets a `textarea` element's current text. Assigning to `value` leaves `defaultValue` unchanged, but changing `defaultValue` can affect what `value` returns while the internal dirty value flag is unset.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptIDBCursor reads IndexedDB records sequentially in key order. A value-bearing cursor exposes cursor.value, while cursor.continue() asynchronously advances to the next record.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptIDBDatabase represents an open connection to an IndexedDB database. It lets you create stores during schema upgrades, start transactions, and close the connection.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support