1. 2
  1.  

  2. 1
    // JQuery
    var commentContent = $('#commentContent').val()
    $('#comments').append('<p class="comment">' + commentContent + '</p>')
    
    // ES6
    const commentContent = document.getElementById('commentContent').value
    const comments = document.getElementById('comments')
    comments.insertAdjacentHTML('beforeend', `<p class="comment">${commentContent}</p>`)
    

    Good example why I keep using jQuery: the ES6 API is really ugly and awkward.