After battling with this for days, I finally figured out how to change the OnClick function for an a HTML anchor tag. This method is compatible with browsers as well as IE.
a.onclick = new Function() {
}