The jquery bind (click) parameter is passed to bind an event to each row in the list, jquerybind

Source: Internet
Author: User

The jquery bind (click) parameter is passed to bind an event to each row in the list, jquerybind

Click a row in the list. Details are frequently displayed. When you click an event with jquey bind, if you do not pay attention to passing the parameter, the same content may be displayed for each row you click. This is mostly because the passing of the parameter is not noticed. The simple code is as follows:

for(var i=0;i<2;i++) { $("#b" + i).bind("click", {'bindText':bindText + i}, function(e){ butClick(e); }); }

Test code:

<Html> 

In jquery, the advantage of bind binding events is that it can be used to implement multiple events? If bind binding is not required, can the tag only implement one event?

What do you mean?

$ ("# Email"). bind ('keydown keyup keypress copy cut paste propertychang', function (e ){
If (! E. keyCode ){
SetTimeout ("chk1 ()", 20)
}

Chk1 ()
});

How does jquery bind an element to multiple click events?

$ ("# Abc"). bind should be acceptable. If not, try $ ("# abc"). click. In fact, there is no difference between the two.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.