¡Wow! ¡Qué velocidad!

... ¡Muchas gracias Caricatos!.
Siguiendo tus consejos el código quedó de la siguiente forma:
(Archivo HTML)
Código:
<html>
<head>
<script type="text/javascript" src="file.js"></script>
</head>
<body onload="foo();">
<form name="the_form">
<a href = "#" id = "elemento">Click!</a>
</form>
</body>
</html>
(Archivo Javascript)
Código:
function mensaje(){
alert("texto");
}
function foo(){
obj = document.getElementById('elemento');
obj.onclick = mensaje;
}