Oggetto sorgente DOM HTML
Oggetto sorgente
L'oggetto Source rappresenta un elemento HTML <source>.
Accedi a un oggetto sorgente
Puoi accedere a un elemento <source> usando getElementById():
Esempio
var x = document.getElementById("mySource");
Crea un oggetto sorgente
Puoi creare un elemento <source> usando il metodo document.createElement():
Esempio
var x = document.createElement("SOURCE");
Proprietà dell'oggetto di origine
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 |
Proprietà ed eventi standard
L'oggetto Source supporta anche le proprietà e gli eventi standard .
Pagine correlate
Esercitazione HTML: video HTML5
Esercitazione HTML: Audio HTML5
Riferimento HTML: tag HTML <sorgente>