Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript One Solution

Why is the button too small?

The button works but it's not big enough for the text and it's barely big enough to see. What am I missing?

// 7: Create a <button> element, and set its text to 'Delete'
// Add the <button> inside the '.extra' <div>
const del = document.createElement('button');
del.textContent + "Delete";
const divE = document.querySelector('.extra');
divE.appendChild(del);
// 8: Remove the '.extra' <div> element from the DOM when a user clicks the 'Delete' button
const divC = document.querySelector('.container');
del.addEventListener('click', () => {
                        divC.removeChild(divE);
                        });

1 Answer

Bramyn Payne
Bramyn Payne
19,589 Points

I believe it is because you have a typo. Check your second line of actual code where you set del.textContent

Thanks, I changed the + to = and it looks right now.