src

object src extends Attr

track - Address of the track (<code>.vtt</code> file). Must be a valid URL. This attribute must be defined. source - Required for <a title="The HTML <audio> element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element:&nbsp;the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream." href="/en-US/docs/Web/HTML/Element/audio"><code><audio></code></a> and <a title="Use the HTML <video> element to embed video content in a document." href="/en-US/docs/Web/HTML/Element/video"><code><video></code></a>, address of the media resource. The value of this attribute is ignored when the <code><source></code> element is placed inside a <a title="The HTML <picture> element is a container used to specify multiple <source> elements for a specific <img> contained in it. The browser will choose the most suitable source according to the current layout of the page (the constraints of the box the image will appear in) and the device it will be displayed on (e.g. a normal or hiDPI device.)" href="/en-US/docs/Web/HTML/Element/picture"><code><picture></code></a> element. video - The URL of the video to embed. This is optional; you may instead use the <a title="The HTML <source> element specifies multiple media resources for either the <picture>, the <audio> or the <video> element. It is an empty element. It is commonly used to serve the same media content in multiple formats supported by different browsers." href="/en-US/docs/Web/HTML/Element/source"><code><source></code></a> element within the video block to specify the video to embed. audio - The URL of the audio to embed. This is subject to <a href="/en-US/docs/HTTP_access_control">HTTP access controls</a>. This is optional; you may instead use the <a title="The HTML <source> element specifies multiple media resources for either the <picture>, the <audio> or the <video> element. It is an empty element. It is commonly used to serve the same media content in multiple formats supported by different browsers." href="/en-US/docs/Web/HTML/Element/source"><code><source></code></a> element within the audio block to specify the audio to embed. img - The image URL. This attribute is mandatory for the <code><img></code> element. On browsers supporting <code>srcset</code>, <code>src</code> is treated like a candidate image with a pixel density descriptor <code>1x</code> unless an image with this pixel density descriptor is already defined in <code>srcset,</code> or unless <code>srcset</code> contains '<code>w</code>' descriptors. input - If the value of the <strong>type</strong> attribute is <code>image</code>, this attribute specifies a URI for the location of an image to display on the graphical submit button, otherwise it is ignored. iframe - The URL of the page to embed. Use <a href="/en-US/docs/Web/Security/Same-origin_policy#Inherited_origins">'about:blank'</a> for empty pages that conform to Same-Origin Policy. embed - The URL of the resource being embedded. script - This attribute specifies the <abbr>URI</abbr> of an external script; this can be used as an alternative to embedding a script directly within a document. If a <code>script</code> element has a <code>src</code> attribute specified, it should not have a script embedded inside its tags.

trait Attr
class Object
trait Matchable
class Any

Type members

Classlikes

object tag extends TagElement

Types

Inherited types

type supports[T <: Tag] = AttrPair[attrType] => AttrPair[tagType]
Inherited from
Attr

Value members

Concrete methods

@inline
def :=(v: String): AttrPair[_src_attr]
@inline
def :=(v: Option[String]): OptionalAttrPair[_src_attr]