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
2 ответов
+ 3
https://code.sololearn.com/W6vXu1dyFuoY/?ref=app
You can also go this route, if you want a separate function.
+ 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.