There's not much difference to do it via a button or a link.
I'm guessing you use onclick="callCode()" in your button tag, right?
If you want, you can use the same for your link since it also supports onclick.
The browser might try to follow a link tho, so to be sure it won't, do something like this: