</dl><!--TOPIC:HTML--><p>The <code><a href=#the-source-element>source</a></code> element allows authors to specify multiple alternative <a href=#media-resource title="media resource">media resources</a> for <a href=#media-element title="media element">media
</dl></div>
<p>The <dfn id=attr-source-media title=attr-source-media><code>media</code></dfn> attribute gives the intended media
type of the <a href=#media-resource>media resource</a>, to help the user agent determine if this <a href=#media-resource>media
resource</a> is useful to the user before fetching it. Its value must be a <a href=#valid-media-query>valid media
query</a>.</p>
<!-- for similar paragraphs, search for "The default, if the" -->
selection algorithm</a> is defined in such a way that when the <code title=attr-source-media><a href=#attr-source-media>media</a></code> attribute is omitted the user agent acts the same as if the
value was "<code title="">all</code>", i.e. by default the <a href=#media-resource>media resource</a> is suitable
for all media.</p>
<div class=impl>
<p>If a <code><a href=#the-source-element>source</a></code> element is inserted as a child of a <a href=#media-element>media element</a> that
has no <code title=attr-media-src><a href=#attr-media-src>src</a></code> attribute and whose <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> has the value <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code>, the user agent must invoke the <a href=#media-element>media
<p>The IDL attributes <dfn id=dom-source-src title=dom-source-src><code>src</code></dfn>, <dfn id=dom-source-type title=dom-source-type><code>type</code></dfn>, and <dfn id=dom-source-media title=dom-source-media><code>media</code></dfn> must <a href=#reflect>reflect</a> the respective content
<p>The IDL attributes <dfn id=dom-source-src title=dom-source-src><code>src</code></dfn> and <dfn id=dom-source-type title=dom-source-type><code>type</code></dfn> must <a href=#reflect>reflect</a> the respective content
attributes of the same name.</p>
</div>
types that define that parameter), represents <a href=#a-type-that-the-user-agent-knows-it-cannot-render>a type that the user agent knows it cannot
render</a>, then end the <a href=#synchronous-section>synchronous section</a>, and jump down to the <i title="">failed with elements</i> step below.</li>
<li><p>⌛ If <var title="">candidate</var> has a <code title=attr-source-media><a href=#attr-source-media>media</a></code> attribute whose value does not <a href=#matches-the-environment title="matches the
environment">match the environment</a>, then end the <a href=#synchronous-section>synchronous section</a>, and
jump down to the <i title="">failed with elements</i> step below.</li>
<li><p>⌛ Set the <code title=dom-media-currentSrc><a href=#dom-media-currentsrc>currentSrc</a></code> attribute to <var title="">absolute URL</var>.</li>
<li><p>End the <a href=#synchronous-section>synchronous section</a>, continuing the remaining steps
<dt><dfn id=attr-script-for title=attr-script-for><code>for</code></dfn> on <code><a href=#the-script-element>script</a></code> elements</dt>
<dd><p>Use DOM Events mechanisms to register event listeners. <a href=#refsDOM>[DOM]</a></dd>
<dt><dfn id=attr-source-media title=attr-source-media><code>media</code></dfn> on <code><a href=#the-source-element>source</a></code> elements</dt>
<dd><p>Use script to select the media resource(s) to use.</dd>
<dt><dfn id=attr-table-datapagesize title=attr-table-datapagesize><code>datapagesize</code></dfn> on <code><a href=#the-table-element>table</a></code> elements</dt>
</dl><!--TOPIC:HTML--><p>The <code><a href=#the-source-element>source</a></code> element allows authors to specify multiple alternative <a href=#media-resource title="media resource">media resources</a> for <a href=#media-element title="media element">media
</dl></div>
<p>The <dfn id=attr-source-media title=attr-source-media><code>media</code></dfn> attribute gives the intended media
type of the <a href=#media-resource>media resource</a>, to help the user agent determine if this <a href=#media-resource>media
resource</a> is useful to the user before fetching it. Its value must be a <a href=#valid-media-query>valid media
query</a>.</p>
<!-- for similar paragraphs, search for "The default, if the" -->
selection algorithm</a> is defined in such a way that when the <code title=attr-source-media><a href=#attr-source-media>media</a></code> attribute is omitted the user agent acts the same as if the
value was "<code title="">all</code>", i.e. by default the <a href=#media-resource>media resource</a> is suitable
for all media.</p>
<div class=impl>
<p>If a <code><a href=#the-source-element>source</a></code> element is inserted as a child of a <a href=#media-element>media element</a> that
has no <code title=attr-media-src><a href=#attr-media-src>src</a></code> attribute and whose <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> has the value <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code>, the user agent must invoke the <a href=#media-element>media
<p>The IDL attributes <dfn id=dom-source-src title=dom-source-src><code>src</code></dfn>, <dfn id=dom-source-type title=dom-source-type><code>type</code></dfn>, and <dfn id=dom-source-media title=dom-source-media><code>media</code></dfn> must <a href=#reflect>reflect</a> the respective content
<p>The IDL attributes <dfn id=dom-source-src title=dom-source-src><code>src</code></dfn> and <dfn id=dom-source-type title=dom-source-type><code>type</code></dfn> must <a href=#reflect>reflect</a> the respective content
attributes of the same name.</p>
</div>
types that define that parameter), represents <a href=#a-type-that-the-user-agent-knows-it-cannot-render>a type that the user agent knows it cannot
render</a>, then end the <a href=#synchronous-section>synchronous section</a>, and jump down to the <i title="">failed with elements</i> step below.</li>
<li><p>⌛ If <var title="">candidate</var> has a <code title=attr-source-media><a href=#attr-source-media>media</a></code> attribute whose value does not <a href=#matches-the-environment title="matches the
environment">match the environment</a>, then end the <a href=#synchronous-section>synchronous section</a>, and
jump down to the <i title="">failed with elements</i> step below.</li>
<li><p>⌛ Set the <code title=dom-media-currentSrc><a href=#dom-media-currentsrc>currentSrc</a></code> attribute to <var title="">absolute URL</var>.</li>
<li><p>End the <a href=#synchronous-section>synchronous section</a>, continuing the remaining steps
<dt><dfn id=attr-script-for title=attr-script-for><code>for</code></dfn> on <code><a href=#the-script-element>script</a></code> elements</dt>
<dd><p>Use DOM Events mechanisms to register event listeners. <a href=#refsDOM>[DOM]</a></dd>
<dt><dfn id=attr-source-media title=attr-source-media><code>media</code></dfn> on <code><a href=#the-source-element>source</a></code> elements</dt>
<dd><p>Use script to select the media resource(s) to use.</dd>
<dt><dfn id=attr-table-datapagesize title=attr-table-datapagesize><code>datapagesize</code></dfn> on <code><a href=#the-table-element>table</a></code> elements</dt>