Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>JS Bin</title>
  </head>
  <body>
    <button id="addNewNumber">Add Another Paragraph</button>
   
    
    <div class="container">
      <h2>Numbers</h2>
      <div class="numbers">
        <p class="one"><span>One</span></p>
        <p class="two"><span>Two</span></p>
        <p class="three"><span>Three</span></p> 
      </div>
    </div>
    
    <script src="https://code.jquery.com/jquery-2.0.3.js"></script>
  </body>
</html>
 
$(() => {
  $('#addNewNumber').click(() => {
    
    // create a new html element
    const htmlOfNewNumber = "<p class='four'> <span>Four</span></p>"
    
    // add new html element to .numbers div
    $('.numbers').html(htmlOfNewNumber)
  })
})
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x