const myList = document.createElement("div");
myList.setAttribute('id', 'name');
const list1 = document.createElement("ul");
const item1 = document.createElement("li");
let value1 = document.createTextNode("america");
item1.appendChild(value1);
const item2 = document.createElement("li");
let value2 = document.createTextNode("london");
item2.appendChild(value2);
list1.appendChild(item1);
list1.appendChild(item2);
myList.appendChild(list1);
Upon entering let li = document.querySelectorAll("#name li");
I can't seem to retrieve the list element with the li tag. What could be causing this issue in the code?