Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use currentSrc in html5

Shulou Source: shulou.com Published: 2022-06-03 15:05:03 09月22日 Update

This article is about how to use currentSrc in html5. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Example

Get the URL of the current video:

MyVid=document.getElementById ("video1"); alert (myVid.currentSrc)

Definition and usage

CurrentSrc is familiar with URL that returns the current audio / video.

If audio / video is not set, an empty string is returned.

Browser support

All major browsers support the currentSrc attribute.

Note: this property is not supported by Internet Explorer 8 or earlier browsers.

Grammar

Audio | video.currentSrc

Technical details

Returns a value string that represents the current URL of the audio / video

Example

Get the URL of the current video:

Tags: Videos browsers support browsing audio content instances properties more articles good practical mainstream characters strings technology articles tags comments see Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Tech Info Microsoft MariaDB OPPO Reno