Difference between jQuery click, bind, live, delegate & trigger functions( with example)
- by I Like PHP
Hello All,
I know there are a lot of questions similar to this, but I want to know clear difference between all of these jQuery functions together on this page with an example, so that it will be very helpful for me to understand the mechanism of all of these functions. I have also read the reference on jQuery main site, but there is no comparison between these:
$().click(fn)
$().bind('click',fn)
$().live('click',fn)
$().delegate('td','click',fn)
$().trigger('click') // UPDATED
Please do not refer any link if there is a part of question belong to that.
Please describe how all four function exactly works in different manner, and which should be preferred in which situation.
Note: If there are any other function with same functionality/mechanism , then please share.
Thanks a lot.
Update
i have also seen $(trigger) function? is this works similar to above four function ?