Click Event







Sourcode

    Try It Yourself
 
<html>
<head>


<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />


<script type="text/javascript" language="Javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

</head>
<body>

<h2>Click Event</h2>
<hr />
<br /><br />

<p>
<asp:Button ID="btnClickMe" runat="server" Text="Click Me to show Alert" />
</p>

<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $("#<%=btnClickMe.ClientID%>").click(
            function () {
                ShowAlert();
            }            
        );

    });


    function ShowAlert() {
        alert("Alert message on click");        
    }
</script>

</body>
</html>
Share with your friends!!