0

Need Help in Javascript Functions

My code is running properly but getting an error Check the code below and help me to solve the error https://code.sololearn.com/WmUG4RZi22FB/?ref=app

15th Jun 2020, 1:49 AM
Abdul Samad
2 odpowiedzi
+ 3
https://code.sololearn.com/W6vXu1dyFuoY/?ref=app You can also go this route, if you want a separate function.
15th Jun 2020, 1:55 AM
Zeke Williams
Zeke Williams - avatar
+ 1
Simply use window.onload = function str(text){ document.getElementById("demo").innerHTML = "hello" ; } to apply the text after page load. What you are doing is calling this function function str(text){ document.getElementById("demo").innerHTML = "hello" ; str("hello"); // This line causes unlimited calls } forever.
15th Jun 2020, 1:54 AM
Parsa Gholipout
Parsa Gholipout - avatar