Objet source HTML DOM
Objet source
L'objet Source représente un élément HTML <source>.
Accéder à un objet source
Vous pouvez accéder à un élément <source> en utilisant getElementById() :
Exemple
var x = document.getElementById("mySource");
Créer un objet source
Vous pouvez créer un élément <source> en utilisant la méthode document.createElement() :
Exemple
var x = document.createElement("SOURCE");
Propriétés de l'objet source
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 |
Propriétés et événements standard
L'objet Source prend également en charge les propriétés et événements standard .
Pages connexes
Tutoriel HTML : vidéo HTML5
Tutoriel HTML : Audio HTML5
Référence HTML : balise HTML <source>