Having a clickable link with your email address on your website is a very practical thing and should not be omitted. But there are robots searching the internet for this email addresses and they will also find your address. The most spam filters are very good but there are always some spam mails that come through and this is very annoying.
I really don’t think it is a solution anymore but on many websites are email addresses in the form
mail[AT]example.com. Maybe some really dumb robots don’t find these but if I would write a bot I would include email addresses like this in my search algorithm.
This is a very simple example that does not work on very old versions of the Internet Explorer and without any error handling. But it does the job.
But again, if I would write an email address search robot I would try to find ajax requests and also look at the destinations of these.
To prevent this it would be possible to integrate some logic on the server that checks if the request for the email address really comes from the website. The second improvement would be to obfuscate the address
This could look like this:
By putting the image in the link it is automatically removed when it is overwritten by
e.innerText = this.responseText;