+ 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
2 Answers
+ 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";
};