Add click event using jquery

To add click event using jquery we use .click method of jquery. We can add click event on page load but we can also add event whenever needed.

<input type="button" value="Click me" id="btnBindClick" />

<script type="text/javascript">

    $(function () {
        $("#btnBindClick").click(function () {
            alert("Click is binded using jquery");
        });
    });
   

</script>

Comments

Popular posts from this blog

Check if ViewBag is null or doesn't exist

Using Progress Bar In C#

Jquery serer side datatables in asp.net