-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New pages: HTMLSourceElement api pages #36855
Conversation
Preview URLs
(comment last updated: 2024-11-26 19:22:20) |
|
||
{{APIRef("HTML DOM")}} | ||
|
||
The **`media`** property of the {{domxref("HTMLSourceElement")}} interface is a string representing a list of one or more media formats to which the resource applies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a list of media formats, is it? It is a media query for the resource (as the example shows).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i copied it from htmllinkelement, which should be updated (not in this PR). changed to:
The
media
property of the {{domxref("HTMLSourceElement")}} interface is a string representing the intended destination medium for the resource. The value is a media query, which is a comma separated list of media-types, media-features, and logical operators.
```js | ||
const el = document.getElementById("el"); | ||
console.log(el.type); // Output: "video/webp" | ||
el.type = "image/webp"; // Updates the type value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (updating the type for an element) seems like a strange thing to do? Maybe more likely would be to create a new source element from scratch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THanks @wbamberg
|
||
{{APIRef("HTML DOM")}} | ||
|
||
The **`media`** property of the {{domxref("HTMLSourceElement")}} interface is a string representing a list of one or more media formats to which the resource applies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i copied it from htmllinkelement, which should be updated (not in this PR). changed to:
The
media
property of the {{domxref("HTMLSourceElement")}} interface is a string representing the intended destination medium for the resource. The value is a media query, which is a comma separated list of media-types, media-features, and logical operators.
```js | ||
const el = document.getElementById("el"); | ||
console.log(el.type); // Output: "video/webp" | ||
el.type = "image/webp"; // Updates the type value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks great.
part of openwebdocs/project#214