Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLSourceElement
  4. src

HTMLSourceElement: src property

Thesrc property of theHTMLSourceElement interface is a string indicating the URL of a media resource to use as the source for the element.

It reflects thesrc attribute of the<source> element nested in an<audio> or<video> element. It has no meaning and is ignored when it is nested in a<picture> element.

Value

A string; the URL of a source resource to use in the element.

Examples

html
<video>  <source       src="large.webp"    type="video/webp"    media="screen and (600px <= width <= 800px)" /></video>
js
const el = document.getElementById("el");console.log(el.src); // Output: "large.webp"el.src = "medium.webp"; // Updates the src value

Specifications

Specification
HTML
# dom-source-src

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp