BPS
BPS

Reputation: 21

How to set alternative text for asp.button

Can alt property used for asp button, not image button?? The text shown in my button is '+'. But while using JAWS for reading the page content, I need this button to be read with some other text rather than reading it as 'plus button'. I have applied alt property that seems not working. Need a help as early as possible.

Upvotes: 2

Views: 2643

Answers (1)

matk
matk

Reputation: 1518

Either set the Tooltip property:

<asp:Button ID="Button1" runat="server" Text="+" ToolTip="plus button" />

which will render as a title attribute:

<input type="submit" name="Button1" value="+" id="Button1" title="plus button" />

Or set the alt attribute directly:

<asp:Button ID="Button1" runat="server" Text="+" alt="plus button" />

which will render as

<input type="submit" name="Button1" value="+" id="Button1" alt="plus button" />

Note that the alt attribute is used to specify alternative text that is to be rendered when the element to which it is applied cannot be rendered, so usually this is used for images, less so for buttons.

Upvotes: 2

Related Questions