so I'm trying to pass the value of "x" here which will generate the random value.
<script>
var result = Math.random().toString(36).substring(2,5);
window.onload = function() {
document.getElementById("x").innerHTML=result;
}
</script>
I want to pass the value to my html code, in the mailto subject. so when people click the link, it will automatically open the default mail and send the email to info@legianbeachbali.com with the subject "Special Promotion + (random code)"
<p style="color: #5b5b5b; text-align: left; id: x;">
<a title="Book Now" href="mailto:info@legianbeachbali.com?subject=Special%20Promotion%20"+x>Book Directly with Us</a></p>
I tried to call the value on id and put "x" in the subject but as I expected, it doesn't work. could you guys please help me? I need to know how to show the value in the subject email.
Thanks in advance.