Ask coding questions

← Back to all posts
How can I make a text change automatically when something happens.
ichbindede

How can I make something automatically changes when something happens in html js and css.[like when player finishes a level 1 it will be write Level 1(Finished)]

Voters
ichbindede
Comments
hotnewtop
InvisibleOne

In the javascript, you can use document.getElementById("id") and then use that to change styling or the value.
Here's an example.
In the HTML we have

And then in the javascript:

ichbindede

ok thanks @InvisibleOne

Coder100

you can set html with js

your HTML!

ichbindede

ok thanks @Coder100

Coder100

mark as correct answer? @ichbindede