JSFiddle - React, Tailwind, and code Playground

HTML

<ul id="ul">
  <li>Привет</li>
  <li>Мир</li>
</ul>

JavaScript

myFunction();
function myFunction() {
    var nodelist = document.getElementById('ul').childNodes;
    
    var txt = "";
    var i;
    for (i = 0; i < nodelist.length; i++) {
        txt = txt + nodelist[i].nodeName + " ";
    }

    console.log(txt);
    console.log(nodelist.length);
}