JavaScript doesn't change html text sometimes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

JavaScript doesn't change html text sometimes

Sometimes I have a problem with changing html text parts with JavaScript. I use a function with a if-else, everytime it goes through it checks if my button has the specific id. This works fine it checks and I can alert something but when I want to change a text with document.getElementById"everywhere_same_id".textContent or innerHtml = specific_text_var_for__each_ button it's doesn't change my text everytime. And I declared for each of the specific_text_var_for_a_button a text. For the whole project I used webslides.js for sliding effects. I use VSCode and I tested the page on MS Edge and on a mobile device with Firefox.

27th Sep 2020, 10:20 AM
TOBI.ON
TOBI.ON - avatar
1 Answer
+ 1
Do you mind showing the piece of code? Because from your explanation I get no idea what is causing the problem.
27th Sep 2020, 11:47 AM
Raj Chhatrala
Raj Chhatrala - avatar