Live () solves the problem where the element event added by jquery using append is invalid and the value of the added element cannot be obtained.

Source: Internet
Author: User

I didn't go to class today. I set a bell for a simple question. I thought it was correct. I added some elements to a div with jquery append, And the element was correctly written. The append element can also be displayed normally with firebug. However, no matter $ (document). Ready (); or clicking an event with the mouse, elements cannot be used.

Jquery actually providesLive ().

 

$ ("Input [name = 'insert']").Live("Click", function (){

Alert(%(this%.parent(%.html ());

VaR familyname = $ (this). Parent (). siblings (". spfamilyname"). Children ("input [name = 'familyname']"). Val ();

VaR familydescribe = $ (this). Parent (). siblings (". spfamilydescribe"). Children ("input [name = 'familydescribe']"). Val ();

Alert (familydescribe + familyname );

});

Problem Solving

 

From: http://hi.baidu.com/cyisi/blog/item/02eeeb16fe56c5dbc2fd78a5.html

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.