call javascript function on hyperlink click

前端 未结 9 1954
陌清茗
陌清茗 2020-11-30 21:13

I am dynamically creating a hyperlink in the c# code behind file of ASP.NET. I need to call a JavaScript function on client click. how do i accomplish this?

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 21:42

    I prefer using the onclick method rather than the href for javascript hyperlinks. And always use alerts to determine what value do you have.

    Link

    It could be also used on input tags eg.

提交回复
热议问题