![]() |
VOOZH | about |
The HTML src attribute specifies the source or location of an external resource to be loaded by an element. It is commonly used to link images, media files, scripts, and embedded content.
Syntax:
<element src="url">| Tag | Description |
|---|---|
| <audio> | Embeds sound content for playback in a webpage. |
| <embed> | Integrates external applications or content. |
| <iframe> | Embeds another HTML document within the current one. |
| <frame> | Deprecated. Divides the browser window. |
| <img> | Embed images for display. |
| <input> | Creates interactive control elements in forms. |
| <script> | Embeds or links to external scripts. |
| <source> | Specifies alternative media resources. |
| <track> | Provides text tracks for multimedia elements. |
| <video> | Embeds video content for playback in a webpage. |
It contains a single value URL that specifies the link of the source file. There are two types of URL links which are listed below:
| Term | Description |
|---|---|
| Absolute URL | Points to a resource outside the current website/domain. |
| Relative URL | Points to a resource within the same website/domain. |
Example 1: In this example we displays GeeksforGeeks heading and an audio player with multiple source files for playback control.
Example 2: In this example image linked via the "src" attribute with an alternative text.