CJCoding With Joseph
15free / daySign inCreate account

JavaScript For Web

Adding The Delete Button

Mini Post Project

Now we are going to add a Delete button so each post can be removed with one click. This is very easy to do and will go inside the same function that builds each post.

Open your buildPostElement function and look for the spot right after you create the <p> tag. We will add our button code there, before we append the elements to newPostEl.

Members only

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 10 more lessons in JavaScript For Web.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel any time.