Audio src attribute
Definition and usage
src
Attribute sets or returns the audio Audio src attribute Value.
src
Attribute defines the location (URL) of the audio file.
Example
Get the URL of the audio file:
var x = document.getElementById("myAudio").src;
Syntax
Return src attribute:
audioObject.src
Set src attribute:
audioObject.src = URL
Attribute value
Value | Description |
---|---|
URL |
URL na'ɓaɓi na'ɗi Possible values:
|
技术细节
返回值: | 字符串值,表示音频文件的 URL。返回整个 URL,包括协议(如 http://)。 |
---|
浏览器支持
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
支持 | 支持 | 支持 | 支持 | 支持 |
所有主流浏览器都支持 src 属性。但是,并非所有浏览器都支持定义的文件格式。
相关页面
HTML 参考手册:HTML