Use the append, prepend, before, and after methods in jquery, and use jqueryprepend.
I. Differences between the after () and before () Methods
After () -- The method is to add parameters in the method to the end of the jquery object;
For example, A. after (B) means to put B behind;
Before () -- The method is to add parameters in the method to the front of the jquery object.
For example, A. before (B) means placing A before B;
Ii. Differences between insertAfter () and insertBefore () Methods
In fact, it is to adjust the position of the element;
It can be an existing element on the page or an element dynamically added.
For example: A. insertAfter (B); that is, Transfer Element A to the end of element B;
For example, <span> CC </span> <p> HELLO </p> uses $ ("span "). after insertAfter ($ ("p"), it becomes <p> HELLO </p> <span> CC </span>. The positions are changed.
Iii. Differences between append () and appendTo () Methods
Append () -- The method is to add parameters in the method to the jquery object;
For example, A. append (B) means to put B in A, append it to the end, and the last position of the child element of;
AppendTo () -- The method is to add the jquery object to the parameter specified by appendTo.
For example, A. appendTo (B) means to put A in B, append it to the end, and the last position of the child element of B;
Iv. Differences between prepend () and prependTo () Methods
Append () -- The method is to add parameters in the method to the jquery object;
For example, A. append (B) means to put B in A and insert it to the first position of the child element of;
AppendTo () -- The method is to add the jquery object to the parameter specified by appendTo.
For example, A. appendTo (B) means to put A into B and insert it to the first position of the child element of B;