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 JavaScript and the DOM (Retiring) Making Changes to the DOM Getting and Setting Text with textContent and innerHTML

My code isnt working

const input = document.querySelector("input");
const p = document.querySelector("p.descrription");
const button = document.querySelector("button");

button.addEventListener("Click" , () => {
  p.innerHTML = input.value + ":";
})

It also did not work with the .textContent I dont know what I am doing wrong

Steven Parker
Steven Parker
231,270 Points

Without seeing the rest of the code, I'd make the same observations as Dimitar has. Please make a snapshot of your workspace and post the link to it here to allow a complete analysis.

1 Answer

Dimitar Dimitrov
Dimitar Dimitrov
11,800 Points

Once reason may be the capital "C" in the click event or the double "r" in p.description for more precise info make a snapshot of your workplace and post it here.