0
I want to give content paragraph with my function and display it in browser. I have error. Thanks you.
Give and Display content. https://code.sololearn.com/WmE5Tino4v9o/?ref=app
2 Respuestas
+ 1
You made a mistake, you shouldn't have called that contenteChild function out.. It's better you do it these way.. 👇👇👇
addEventListener('load', () =>{
//you then call that function here
contenteChild()
})
//Then you write the function below
function contenteChild(){
document.getElementById('child').innerHTML = "malick"
}
0
Use onload() in JS to run the code after the page is loaded.
window.onload = () => {
function contenteChild () {
document.getElementById ("child").innerHTML = "malick";
}
contenteChild();
}