What is the purpose of the `src` attribute?

QuestionsQuestions8 SkillsProHTML ImagesOct, 19 2025
0139

The src attribute is commonly used in HTML and other markup languages to specify the source of an external resource. For example, in an <img> tag, the src attribute indicates the URL of the image to be displayed. In a <script> tag, it specifies the URL of the JavaScript file to be executed.

Here’s a brief example:

<img src="image.jpg" alt="Description of image">
<script src="script.js"></script>

In these examples, the src attribute tells the browser where to find the image and the JavaScript file, respectively.

0 Comments

no data
Be the first to share your comment!