HTML DOM Bronvoorwerp
Bronvoorwerp
Die Bron-objek verteenwoordig 'n HTML <bron>-element.
Toegang tot 'n Bronvoorwerp
Jy kan toegang tot 'n <source>-element kry deur getElementById():
Voorbeeld
var x = document.getElementById("mySource");
Skep 'n Bronvoorwerp
Jy kan 'n <source> element skep deur die document.createElement() metode te gebruik:
Voorbeeld
var x = document.createElement("SOURCE");
Bronvoorwerpeienskappe
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 |
Standaard eiendomme en geleenthede
Die Bron-objek ondersteun ook die standaard eienskappe en gebeurtenisse .
Verwante bladsye
HTML-tutoriaal: HTML5-video
HTML-tutoriaal: HTML5 Audio
HTML-verwysing: HTML <bron>-merker