+ 1
Hi guys this code is working but only this way,that means when i seperate the script in sololearn code playground it doesn't run
<html> <head></head> <body> <h1 id="demo">hi</h1> <script> var a=document.getElementById("demo"); a.innerHTML = "hello"; </script> </body> </html>
2 Answers
+ 5
Use window.onload
Syntex
window.onload = function (){
Your javascript code
}
0
Thanks it worked,thank you very much dude