Obiekt źródłowy HTML DOM
Obiekt źródłowy
Obiekt Source reprezentuje element HTML <source>.
Uzyskaj dostęp do obiektu źródłowego
Możesz uzyskać dostęp do elementu <source> za pomocą getElementById():
Przykład
var x = document.getElementById("mySource");
Utwórz obiekt źródłowy
Możesz utworzyć element <source> za pomocą metody document.createElement():
Przykład
var x = document.createElement("SOURCE");
Właściwości obiektu źródłowego
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 |
Standardowe właściwości i zdarzenia
Obiekt Source obsługuje również standardowe właściwości i zdarzenia .
Powiązane strony
Samouczek HTML: wideo HTML5
Samouczek HTML: dźwięk HTML5
Odniesienie HTML: tag HTML <source>