javascript Write out email address

function Email() {
    // buils up an email address to prevent spam
	var user = 'hello';
	var domain = 'example';
	var extension = '.com';
	var subject = 'Contact from website';
	var email = user + '@' + domain + extension
	document.write('<a href=\"mailto:' + email + '?subject=' + subject + '\">' + email +'</a>');
}

//usage:
//<script type="text/javascript">Email();</script>
Writes out an email address using client-side javascript, to try to prevent spam.

Updated: Saturday 9th October 2010, 10:34pm

There are 0 comments

Leave a comment of your own

Comments are currently closed.