HTMLSourceElement
The interface for <source>. Extends HTMLElement → Element.
Reflected properties
All setters are guarded and throw NoModificationAllowedError on a read-only document.
| Property | Attribute | Type | Notes |
|---|---|---|---|
src |
src |
string | Reflects verbatim — no base-URL resolution. |
type |
type |
string | Reflects the content attribute verbatim. |
srcset |
srcset |
string | Reflects the content attribute verbatim. |
sizes |
sizes |
string | Reflects the content attribute verbatim. |
media |
media |
string | Reflects the content attribute verbatim. |
See also
- Element —
getAttribute/setAttribute, content,classList, traversal, insertion - HTMLElement — the global reflected properties every HTML element inherits
- JavaScript DOM API — the interface hierarchy and
instanceof