Link button with javascript function
It was believed that it was better to attach it via JavaScript. This is categorized as " Unobtrusive JavaScript ." (more specifically here is the separation of behavior from the layout)
document.getElementById('YourID').onclick = nameOfFunctionToBeCalled;
I use an event ondomreadyto assign all of my events, usually waterless in a separate script. All my logic is in one place, and my markup looks a lot neater. I am of the opinion that markup is simply intended to describe the initial structure of the page. The code lives in the code file, and the styles belong in the css file.