.append()

.append() Method

  • Method used to insert content to the end of selected elements (as the last child)

Example

$(() => {
  $('#appendParagraph').click(() => {
    // append a new paragraph to list of paragraphs
    const newParagraph = "<p class='four'>Four</p>"
    $('.numbers').append(newParagraph)
  })
})

JS Bin on jsbin.com