I am trying to create a website where I have this button and every single time you click it, a new pre-filled email will pop up. I know how to link the email, but is there a way I can do it so that every time I click the button, it's a random email I already pre-filled?
This is my code right now:
<li><a href="mailto:?"><i class="fa fa-envelope"></i></a></li>
var diffEmails = [
// (code deleted off here because
// I didn't want to show the email/pre-filled email body for privacy reasons)
];
function randomEmails() {
var i = parseInt(Math.random() * diffEmails.length);
location.href = diffEmails[i];
}
<a href="mailto:" >onclick="randomEmails();"></a>
I used a social media icon from font awesome and don't want to delete it so how could I use this in my HTML