Código:
<html> <head> <script language="javascript"> function apagar(even) { var evento = window.event || even; if (String.fromCharCode(evento.charCode) == "a") { document.getElementById("texto").disabled = true; } } function prender() { if (document.getElementById("texto").disabled == true) { document.getElementById("texto").disabled = false; } } window.onload = function() { document.getElementById("texto").onkeypress = apagar; document.getElementById("texto").onmouseover = prender; } </script> </head> <body> <input type="text" id="texto" > </body> </html>