How to Use jquery to insert a new li element after any specified li element, jqueryli

Source: Internet
Author: User

How to Use jquery to insert a new li element after any specified li element, jqueryli

How to Use jquery to insert a new li element after any specified li element:
This section describes how to use jquery to insert a new li element to the end of any li element.
Native javascript can use the insertBefore () function. For more information, see section 1 of insertBefore, insertAfter, and appendChild in javascript.
The following describes how to use jquery to implement this function.
Code example:

<! DOCTYPE html> 

The above Code meets our requirements. click the button to add a new li element to the end of the second li element.
Related reading:
1. For more information about the eq () function, see section 1 of jQuery's eq () method.
2. For the after () function, see the after () method section of jQuery.
3. For details about the prop () function, refer to the prop () method section of jQuery.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 15190.

For more information, see: http://www.softwhy.com/jquery/

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.