How to only add something to html with js | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to only add something to html with js

I made a program that calculates the fibbonacci series until 4000 is reached, but i cant add in the span i made, i only can replace the text https://code.sololearn.com/W9sIJJlLidVq/?ref=app

20th Apr 2018, 11:04 PM
Roel
Roel - avatar
3 Answers
+ 4
https://code.sololearn.com/WepAcBz38J4F/#html
20th Apr 2018, 11:21 PM
Emma
+ 4
document.getElementById("body").innerHTML = document.getElementById("body").innerHTML + " " + number; You need to include the old html with your new one.
20th Apr 2018, 11:34 PM
Toni Isotalo
Toni Isotalo - avatar
0
and how do i make a constantly repeating if loop like this: function(){ //function goto function() } is this possible?
21st Apr 2018, 7:41 AM
Roel
Roel - avatar