The Wayback Machine - http://web.archive.org/web/20220614043041/https://www.geeksforgeeks.org/html-src-attribute/amp/

HTML src attribute

The html src attribute is used to specify the location (URL) of the external resource.

Supported tags:  

Attribute Values: It contains single value URL which specifies the link of source file. There are two types of URL link which are listed below:

Example: HTML audio src attribute  




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML audio src Attribute
    </title>
</head>
 
<body style="text-align:center;">
     
    <h1>GeeksforGeeks</h1>
     
    <h2>
        HTML audio src Attribute
    </h2>
     
    <audio controls muted>
        <source src="GFG.mp3" type="audio/mp3">
        <source src="GFG.ogg" type="audio/ogg">
    </audio>
</body>
 
</html>                    

Output:  



Example: HTML img src Attribute  




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML img src Attribute
    </title>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
 
    <h2>HTML img src Attribute</h2>
 
    <img src=
        alt="GeeksforGeeks logo">
</body>
 
</html>

Output:  

Supported Browsers: The browsers supported by HTML src attribute are listed below: 
 

 




Article Tags :
Practice Tags :