How to call JavaScript function on button click?

 Posted by Rajesh_Kumar on 2/11/2014 | Category: JavaScript Interview questions | Views: 1998 | Points: 40
Answer:

We can use OnClientClick event of Button control for raising any Javascript function.

For Example:-
function alert_msg()

{
alert('rajesh');
}

<asp:button id="btn_alert" OnClientClick="alert_msg();"/>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response