title: How to get first level children via querySelectorAll(selector)
body: <p>If we have a UL list with nested UL lists like</p>
  <pre><code>&lt;ul&gt;
      &lt;li&gt;Item
          &lt;ul&gt;
              &lt;li&gt;Subitem&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  <p>and we need to get all the LI elements of the first level only, we can use <code>querySelectorAll()</code> the way like:</p>
  <pre><code>let firstLevelChildren = document.querySelectorAll('ul &gt; li');
  </code></pre>
  <p>But what if I create the UL list via <code>document.createElement('ul')</code> and need to get the first level children of such specific node via <code>querySelectorAll(selector)</code>?</p>
  <p>Is there a selector?</p>
  <p>I know about <code>node.children</code>, but I need a way via <code>querySelectorAll()</code>.</p>
  <p>There may be any unknown number of the first level children. Also there may be different cases like <code>'&gt; li &gt; ul'</code> and so on.</p>
  <p>The way like:</p>
  <pre><code>let ul = document.createElement('ul');
  ul.innerHTML = '&lt;li&gt;Item&lt;ul&gt;&lt;li&gt;Subitem&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;';
  let items = ul.querySelectorAll('&gt; li');
  console.log(items);
  </code></pre>
  <p>throws the error</p>
  <blockquote>
  <p>' &gt; li' is not a valid selector.</p>
  </blockquote>