How do you include js on ur code in sololeran since you can not reference my code is didn't work so i includeded it in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

How do you include js on ur code in sololeran since you can not reference my code is didn't work so i includeded it in html

How do you include javascript in your code at sololearn since when i used javascript code in js part it didnt work "using .innerHtml &.textContent" it showed an error of null property ,so i had to include it inside html document for it to work.plz help if u can

5th Jul 2019, 5:51 AM
Innocent
Innocent - avatar
1 Answer
+ 3
You can use it, but it executes the javascript code first, before the document loads, meaning that the elements you want to access don't exist yet. To avoid this, you might want to use the window.onload function, it executes when the document loaded. Example: window.onload = () => { document.getElementById("no").innerText = "Yes"; };
5th Jul 2019, 5:54 AM
Airree
Airree - avatar