call javascript function on hyperlink click

前端 未结 9 1945
陌清茗
陌清茗 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:48

    Use the onclick HTML attribute.

    The onclick event handler captures a click event from the users’ mouse button on the element to which the onclick attribute is applied. This action usually results in a call to a script method such as a JavaScript function [...]

提交回复
热议问题