title: JavaScript error: Uncaught TypeError: Cannot read property 'remove' of undefined
body: <p>I have a script to remove uploaded files after Add to success, but I get this error on site when it loads.</p>
  
  <pre><code>"Uncaught TypeError: Cannot read property 'remove' of undefined"
  </code></pre>
  
  <p>What's missing?</p>
  
  <pre><code>&lt;script&gt;
  onload=function() {
      document.querySelectorAll("li[id^='uploadNameSpan']")[0].remove();
  }
  &lt;/script&gt;
  </code></pre>