As you can see from the syntax highlighting you have at least one error in your code. In your call to
addMessageDiv you forgot to close your string.
I don't know that I'm understanding correctly but it sounds to me that you don't want a link to act like a link. When you click on it you'd rather some custom code happen and not a page load/refresh.
If that's the case, in your onClick event handler definition you need to pass in an event object (lets call it
e) as a parameter. Then in your handler body you need to prevent the default action with
An example would be:
// Do something cool here!
Hopefully this helps and I'm not WAY off base here.