Skip to content

Tag: javascript

Button changing newest div item instead of the correct

I created a div table of sorts, where there is a button, and that button creates a box, and what is supposed to happen is that you can click any of the {x} boxes and it colors it black However, instead of coloring that box black(or white), it colors the newest one black(or white). How do I change this? HTML:

The number of people cannot be initialized in the word chain game

This is a word chain game I made. When the game is over, the text is initialized. Other texts are initialized fine, but the text in span.number-of-people is not. In the console window console.log(numberOfPeople.textContent); It looks like it has been initialized. But why is the number not erased from the scre…

Unable to accessible some code in TypeScript TS

I have a simple if else code in TypeScript.But in some code unable to access it.It shows me the following error, “Cannot read properties of undefined (reading ‘setNewsProvider’)” Code Answer Inside the forEach loop you enter a function, the function has it’s own this value. To av…