What is the purpose of the tag in HTML?

The <img> tag in HTML is used to embed images into a webpage. It doesn’t have a closing tag and requires the src attribute, which specifies the path to the image file, and the alt attribute, which provides a text description of the image for accessibility and SEO. For example:

<img src="image.jpg" alt="A sample image">

This tag allows users to view images alongside text, creating a more engaging and visually appealing webpage.