- 1
How can i add text without changing anything else?
4 ответов
+ 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