this code in css works fine:
#translatemenu134 ul ul li:nth-child(1){
background-color:blue;
}
but when I use this code in java script:
var translateOption = document.querySelector("#translatemenu134 ul ul li:nth-child(1)");
translateOption.addEventListener("click", function(){
document.getElementById("languagebar001").innerHTML = "<span style='font-size:16px'><i class='fal fa-globe'></i> EN</span>";
});
I face to this error in console: "Cannot read property 'addEventListener' of null" is this because of that the page is still loading and it does not find the element or I have done something wrong in the code? thank you for your response in advance