In jQuery what is means .append(), prepend(), .after() and .before()

0 Shares
0
0
0
0
0
0
0

You can see from the image that .append() and .prepend() adds the new elements as childelements (brown colored) to the target.

And .after() and .before() adds the new elements as sibling elements (black colored) to the target.

Here is a DEMO for better understanding.

This image displayed below gives a clear understanding and shows the exact difference between .append(), .prepend(), .after() and .before()

Reference Click Here