Bind event to event handler in jquery

<script type="text/javascript">
 $(document).ready(function(){
    $("#b1").bind("click", function() {
             var message="You clicked a button";
             window.alert(message);
    });
});
</script>
<p><input type="button" id="b1"  value="Click Me"/></p>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.