+ 1
Am trying to select html elements using document.querySelector but i get "null" as a result...
4 Answers
+ 2
Check my answer
https://www.sololearn.com/Discuss/2520324/?ref=app
+ 1
Mind to share that troubling code?
(Edit)
Code link attached đ
Here's how to do that đ
https://www.sololearn.com/post/75089/?ref=app
+ 1
wrap your code in a window.onload function, your js is executing before the dom has loaded
0
chinaza Aa said by @Brains[Bindex] Add Like this, js code :
window.onload = ()=>
{
let ele = document.querySelector(".p1");
console.log(ele);
}