I have an <img> that is when clicked should perform an action, so I wrapped it inside a <button> like this:
<button>
<img src="" alt="Cat">
</button>
Regarding accessibility, a button in the accessibility tree should have a role and label associated to it. The role is done using <button> tag and normally, a button's label is its content inside the opening and closing tags, but in our case there's only an image.
So how to make the button accessible in this case? Is the alt attribute enough?