The alt
attribute is for plain text. So it can’t contain hyperlinks, but it can contain URLs.
Custom implementations aside, a screen reader wouldn’t offer to visit the URL, but it would read it out. Depending on the screen reader, the user might have to switch to a different mode to also hear the punctuation (the parts "https" and "www" should suffice as indicators for recognizing that it’s a URL).
So at that point, it’s like a radio advertisement which contains a URL. Interested people can remember it (or note it down), and enter it manually.
But should the alt
attribute contain URLs?
Only in one case: if the image shows URLs.
Relevant guidelines (from HTML’s Requirements for providing text to act as an alternative for images):
However, in such a case it might be better to use an alternative to img
+alt
, which allows using a hyperlink (a
).
In your example, the alt
attribute should not contain the URL, as it’s not part of the image. The URL might also be interesting for users that don’t read the alt
text (as it allows copy-pasting, might contain updates, gives more information about the author, and so on), so the best solution would be to link it next to the image (which the answer already does).