title: Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '' is not a valid selector
body: <p>I have a list with two items. The second item's ID is generated by <code>getTime()</code> and concatenated with <code>new$</code>, forming a random ID as shown in the image below.</p>
  
  <p><a href="https://i.stack.imgur.com/yKq5K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yKq5K.png" alt="enter image description here"></a></p>
  
  <p>I need to target that element to perform some functions, but when I try to do that using <code>querySelector</code>, it produces an error saying that it is not a valid selector, even when I use <code>String()</code> to covert the generated random number to a string.</p>
  
  <p><a href="https://i.stack.imgur.com/aVMLF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aVMLF.png" alt="enter image description here"></a></p>
  
  <p>What am I missing here? </p>