2nd Jun 2022, 12:57 PM
ESLAM YASSER
ESLAM YASSER - avatar
4 Answers
+ 1
Solo CalviÕ² i found the solution / just need to add script tag at the end of body tag which do what you said šŸ™‚šŸ˜‰
2nd Jun 2022, 9:22 PM
ESLAM YASSER
ESLAM YASSER - avatar
+ 1
window.addEventListener ("DOMContentLoaded", init); function init () { let first = document.querySelector("#one"); console.log(first.textContent); }
2nd Jun 2022, 1:25 PM
CalviÕ²
CalviÕ² - avatar
+ 1
onload=()=>{ let first = document.querySelector("#one"); console.log(first.textContent); } The use of onload is necessary to wait for the html-document to be completely loaded, since in SoloLearn JavaScript is loaded first and does not see the tag with id="one".
2nd Jun 2022, 3:32 PM
Solo
Solo - avatar
0
Solo CalviÕ² sry i didn't get why should I add function ?
2nd Jun 2022, 2:00 PM
ESLAM YASSER
ESLAM YASSER - avatar