In another question, someone is suggesting that an image can be made focussable? How can one achieve this?
More information:
In the other question, Quentin says:
var img= $("#my-image-id");
image.click(function() {
// your code here
}
Don’t do this. The image will not be focusable (since images are not
designed to be interactive controls). People using (for instance) a
keyboard to navigate through the page (instead of a pointing device
like a mouse) won’t be able to navigate to the image and activate the
control.
Someone else says:
In your case that you want to maintain the “focus” (i assume with
tabbing support), if you use a single as a button (with or
without ), you will have to add some JS code to make the image
focusable when the appropriate tab is pressed. So you will have to
write a bit more code to do the same thing.
To make an image (or any element) focusable, just add a
tabindexattribute.But note that there is no need for any special treatment just to make an image respond to
clickevents.