1

I came across this line of code

<button onclick="Set_Delete()" id="btnDelete" alt="submit" >Delete</button>

I'm not able to understand what is the use of alt in a button tag. Can anyone elaborate it?

  • Possible duplicate: https://stackoverflow.com/questions/25423029/can-the-alt-attribute-be-used-for-an-input-type-button – abhishekkannojia Jul 03 '17 at 08:17
  • i don't know button have `alt`.I think its image tag only have a alt or `type="image"` – prasanth Jul 03 '17 at 08:18
  • Possible duplicate of [can the alt attribute be used for an input type button](https://stackoverflow.com/questions/25423029/can-the-alt-attribute-be-used-for-an-input-type-button) – prasanth Jul 03 '17 at 08:19

1 Answers1

0

The alt attribute provides an alternate text for the user, if he/she for some reason cannot view the image (because of slow connection, an error in the src attribute, or if the user uses a screen reader).

Note: The alt attribute can only be used with input type image and code in your question is Invalid

mshomali
  • 664
  • 1
  • 8
  • 27