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/