Movatterモバイル変換


[0]ホーム

URL:


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

HTMLMediaElement: src property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

TheHTMLMediaElement.src property reflects the value ofthe HTML media element'ssrc attribute, which indicates the URL of a mediaresource to use in the element.

Note:The best way to know the URL of the media resource currentlyin active use in this element is to look at the value of thecurrentSrc attribute, which also takesinto account selection of a best or preferred media resource from a list provided inanHTMLSourceElement (which represents a<source>element).

Value

A string containing the URL of a media resource to use in theelement; this property reflects the value of the HTML element'ssrcattribute.

Examples

js
const obj = document.createElement("video");console.log(obj.src); // ""

Specifications

Specification
HTML
# dom-media-src

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp