Objeto de origen HTML DOM
Objeto de origen
El objeto Source representa un elemento HTML <source>.
Acceder a un objeto de origen
Puede acceder a un elemento <source> usando getElementById():
Ejemplo
var x = document.getElementById("mySource");
Crear un objeto de origen
Puede crear un elemento <source> utilizando el método document.createElement():
Ejemplo
var x = document.createElement("SOURCE");
Propiedades del objeto de origen
Property | Description |
---|---|
media | Sets or returns the value of the media attribute in a <source> element |
src | Sets or returns the value of the src attribute in a <source> element |
type | Sets or returns the value of the type attribute in a <source> element |
Propiedades y eventos estándar
El objeto Source también es compatible con las propiedades y los eventos estándar .
páginas relacionadas
Tutorial HTML: vídeo HTML5
Tutorial HTML: Audio HTML5
Referencia HTML: etiqueta HTML <fuente>