This will allow one click to perform an action, and then subsequent clicks will do nothing.
<html>
<head><title>Say Hello</title></head>
<body>
<script type="text/javascript">
function returnFalse() {
return false;
}
function sayHello(element) {
alert("Hello!");
element.onclick = returnFalse;
return false;
}
</script>
<a href="#" onclick="sayHello(this);">Say Hello</a>
</body>
</html>
If you want to do this dynamically (i.e., without hard coding the onclick handler that initially gets called), then you'd have to do it slightly differently.