title: the focus() function does not see the existing element
body: <p>I have two lines of code:</p>
  <p><code>1</code> <code>console.log(currentPopup.querySelector(&quot;input&quot;));</code><br />
  <code>2</code> <code>currentPopup.querySelector(&quot;input&quot;).focus();</code></p>
  <p>Before calling the <code>focus()</code> function on an element (<code>input</code>), I want to check if it (<code>input</code>) even exists (line 1).</p>
  <p>In console I get the following:</p>
  <p><a href="https://i.stack.imgur.com/6fbfv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6fbfv.png" alt="enter image description here" /></a></p>
  <p>This means that the element I need exists and I can call the <code>focus()</code> function on it, but the function does not work<br />
  What am I doing wrong?</p>