+ 1
[SOLVED] innerHTML append text
How can I modify the append in innerHTML? For example: .innerHTML += ("<br />", textvar); Output: textvartextvartextvartextvar Any,help will be appariciated! https://code.sololearn.com/WQXqc89ObFJY/?ref=app
3 Respostas
+ 3
use .innerHTML += "<br/>"+textvar;
+ 2
+ is used since you want to add the textvar to the breakline
no () is used since you dont neccessarily have to add things first, and just add everything in the order you wrote, but dont mind using them, its just not neccessary, but if it looks better to you, go ahead and use them, it wont affect anything
+ 1
Roel,
It worked, thanks!
Can you give me some explanation on what the difference is between what I did and your answer?
Why it worked without () and with +
Why it didn't worked with () and ,