- 1
How can i add text without changing anything else?
4 Answers
+ 2
What do you mean? Give more details/be more specific. Better yet, give an example of what you want to do and whatâs preventing you from doing that right now.
+ 1
do
document.querySelector(â#myDivIDâ).innerHTML += âthe text I want to addâ
it will add text to the end of the content inside the div. For example, if I put
<div id=âexampleâ>Text is here!</div>
and then ran
document.querySelector(â#exampleâ).innerHTML += â More text is here!â
I would then have a div with âText is here! More text is here!â in it.
0
I would like to add text without clearing anything or changing anything. This also needs to be inside a script inside a div. Also, it needs to work like document.write.
0
Thanks