Jquery Bind Example - Jquery

How to use bind method in jquery?

Snippet Code


  
Rate this page :
  [ 0 votes]

This simple jquery code allows you to attach one or more event handlers for selected elements. Here bind() method is used to attach an event for the div element. The sample jquery bind code is given below.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script> $(document).ready(function(){ $("div").bind("click", function(){ alert("This is bind element."); }); }); </script> <div>Click me!</div>

Tags


Ask Questions

Ask Question