Should Buttons have an ALT?

Should I have an alt attribute in this button code…


		<!-- Submit Form -->
		<input type="submit" name="logIn" class="button" value="Log In" />

Debbie

Unless you using an image input, i.e. (type=“image”), and you aren’t you have chosen (type=“submit”) hence there is NO need the for the alt attribute.

I am using a background image, though.

But I guess even if my background image fails, the user would still see “Submit”, right?

Debbie

Yup

Or rather, “Log In”. :slight_smile:

Oh, okay, thanks for the clarification.

Debbie

I never do this and although I dont think it will do any harm I dont think it will do anything good either.

Adding in code that’s not part of the HTML specification could do you some harm because it’s not going to validate. Also, there’s just no sense is bloating your code with things you don’t need. Better site speed = better seo.