Lee Ikard Lee Ikard - 6 months ago 66
HTML Question

Javascript add date and time to mailto subject link

I want to put the current date and time into the subject of a

mailto:
link.
Here's my code so far:

(I can't paste my code for some reason. Ill use pastebin)
http://pastebin.com/FUwZrBwv
How, in javascript, can I find the
subject =
line and add to that?



var d = new Date(86400000);
document.getElementById("demo").innerHTML = d;

Problem? <a href="mailto:leeeyecard@gmail.com?subject=ServerError">Click!</a>
<div id="timedowndiv">
<p>Redirecting in 3 seconds . . .
</div>




Answer

Why not use sth similar to,

<a href="javascript:var date = new Date(); window.open('mailto:test@example.com?subject='+date +'&body=body');">test</a>
Comments