prepend() Method


The prepend() method is used to insert new content at the beginning of selected elements.

The added content appears before existing content inside the element.

This method is useful when you want new items to appear first.

This adds a list item at the top of the list.

This inserts content before existing elements inside the container.

Prepend is commonly used in notification systems.

prepend() Method Notes:

  • Inserts content inside element
  • Adds at the beginning
  • Keeps existing content
  • Used for newest-first display