The difference between the after () and before () methods
After ()--the method is to add the parameters inside the method to the jquery object;
For example: A.after (b) means to put B behind A;
Before ()--the method is to add the parameters inside the method to the jquery object.
For example: A.before (b) means putting A in front of B;
Ii. differences between the methods of InsertAfter () and InsertBefore ()
In fact, the element is swapped position;
It can be an existing element on the page, or it can be a dynamically added element.
such as: A.insertafter (b); A element will be swapped to the B element;
such as <span>CC</span><p>HELLO</p> use $ ("span"). InsertAfter ($ ("P")), it becomes <p>hello</p ><span>CC</span>. The two positions are switched.
Iii. differences between the Append () and Appendto () methods
Append ()--the method is to add the parameters inside the method to the jquery object;
For example: A.append (b) means placing B in a, appended to the last position of the child element of A;
AppendTo ()--the method is to add the jquery object to the parameters specified in the AppendTo.
For example: A.appendto (b) means to put A into B, appended to the last position of the child element of B;
Iv. differences between the prepend () and Prependto () methods
Prepend ()--the method is to add the parameters inside the method to the jquery object;
For example: A.append (b) means putting B in a and inserting it into the first position of the child element of A;
Prependto ()--the method is to add the jquery object to the parameters specified in the appendto.
For example: A.appendto (b) means putting A into B, inserting the first position of the child element of B;
jquery dynamically inserts append, Prepend, before, after differences