![]() |
Definition and Usage
The Applies to
The
Browser Support
The
|
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The audio src attribute</h1>
<p>Click on the play button to play a sound:</p>
<audio src="https://file-examples.com/wp-content/storage/2017/11/file_example_MP3_700KB.mp3" controls>
Your browser does not support the audio element.
</audio>
<p><b>Note:</b> The .ogg fileformat is not supported in IE or Safari.</p>
</body>
</html>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The embed src attribute</h1>
<embed src="https://horje.com/avatar.png">
</body>
</html>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The iframe src attribute</h1>
<iframe src="https://horje.com"> <p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The img element</h1>
<img src="https://horje.com/avatar.png" alt="Girl in a jacket" width="500" height="600">
</body>
</html>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The input src attribute</h1>
<p>Click on the image, and the input will be sent to a page on the server called "/action_page.php".</p>
<form action="/action_page.php"> <label for="fname">First name:</label> <input type="text" id="fname" name="fname"><br><br> <input type="image" src="https://horje.com/avatar.png" alt="Submit" width="48" height="48">
</form>
<p><b>Note:</b> The image input type sends the X and Y coordinates of the click that activated the image button as default.</p>
</body>
</html>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The script src attribute</h1>
<script src="demo_script_src.js">
</script>
</body>
</html>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The source element</h1>
<p>Click on the play button to play a sound:</p>
<audio controls> <source src="https://file-examples.com/wp-content/storage/2017/11/file_example_MP3_700KB.mp3" type="audio/ogg"> <source src="https://file-examples.com/wp-content/storage/2017/11/file_example_MP3_700KB.mp3" type="audio/mpeg"> Your browser does not support the audio element.
</audio>
</body>
</html>
Example:
HTML
<video width="320" height="240" controls> <source src="https://www.sample-videos.com/video321/mp4/360/big_buck_bunny_360p_10mb.mp4" type="video/mp4"> <source src="https://www.sample-videos.com/video321/mp4/360/big_buck_bunny_360p_10mb.mp4" type="video/ogg"> <track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English"> <track src="subtitles_no.vtt" kind="subtitles" srclang="no" label="Norwegian">
</video>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The video src attribute</h1>
<video width="320" height="240" controls src="https://www.sample-videos.com/video321/mp4/240/big_buck_bunny_240p_30mb.mp4"> Your browser does not support the video tag.
</video>
<p><b>Note:</b> The .ogg fileformat is not supported in old IE and Safari.</p>
</body>
</html>
html src attribute |
How to add An audio player - HTML src Attribute | HTML Attribute |
How to add An embedded flash animation - HTML src Attribute | HTML Attribute |
How to add An <iframe> in its simplest use - HTML src Attribute | HTML Attribute |
How to add An image is marked up as follows - HTML src Attribute | HTML Attribute |
How to add An HTML form with an image that represents the submit button - HTML src Attribute | HTML Attribute |
How to Point to an external JavaScript file - HTML src Attribute | HTML Attribute |
How to add An audio player with two source files. The browser should choose which file (if any) it has support for - HTML src Attribute | HTML Attribute |
How to add A video with two subtitle tracks - HTML src Attribute | HTML Attribute |
How to add Video Example - HTML src Attribute | HTML Attribute |
Type
: |
Develop |
Category
: |
Web Tutorial |
Sub Category
: |
HTML Attribute |
Uploaded by
: |
Admin |
Read Article https://horje.com/learn/1434/reference