Ah, it's not a JSP problem then, but an HTML and Javascript problem.
You're looking for
Code:
<a href="javascript:void(0)" onClick="testLink('<%= a_name %>')"><%= h_Nm %></a>
"javascript
:void(0)" will allow you to execute Javascript using the anchor tag by basically telling the browser to not follow the hyperlink like it usually would. You can then use the "onClick" or other attribute.
Because you're handing the value directly to the function, you'll need to quote it, but you don't want to break out of the quote used by the "onClick", so you need to use the single quote.
Re-arraign to taste.