Q
Which attribute is used to specify an alternative text for an image in HTML?

Answer & Solution

Answer: Option A
Solution:
The alt attribute is used to specify alternative text for an image in HTML, which is displayed when the image cannot be loaded or by screen readers for accessibility purposes.
Related Questions on Average

What is the correct HTML syntax for inserting an image?

A). <img src='image.jpg' alt='Image'>

B). <image src='image.jpg' alt='Image'>

C). <img href='image.jpg' alt='Image'>

D). <image href='image.jpg' alt='Image'>

Which tag is used to create an unordered list in HTML?

A). <ul>

B). <ol>

C). <li>

D). <ul>

What is the correct HTML syntax for creating a hyperlink with the text 'Click Here' that links to 'example.com'?

A). <a href='http://example.com'>Click Here

B). <a src='http://example.com'>Click Here

C). <a link='http://example.com'>Click Here

D). <a url='http://example.com'>Click Here

What does the href attribute specify in HTML?

A). The URL of the linked document

B). The alternative text for the image

C). The text content of a hyperlink

D). The name of the anchor within a document

Which tag is used to define the main content of an HTML document?

A). <main>

B). <content>

C). <article>

D). <body>

What is the purpose of the <title> tag in HTML?

A). To define the title of the web page

B). To create a heading

C). To insert an image

D). To define a hyperlink

Which HTML element is used to define a table row?

A). <tr>

B). <td>

C). <table>

D). <th>

Which tag is used to create a hyperlink in HTML?

A). <a>

B). <p>

C). <img>

D). <div>

Which of the following is a semantic HTML element?

A). <header>

B). <div>

C). <span>

D). <b>

What does the <iframe> tag in HTML do?

A). It creates an inline frame for embedding external content

B). It defines a section within a document

C). It inserts an image

D). It creates a hyperlink