title: How to check for script src match, then reassign src
body: <p>I need to check every <code>script</code> tag's src value and if there is a match, I would like to change that script tags src attribute... Something like this:</p>
  
  <pre><code>var scripts = document.getElementsByTagName("script")[0].src
  
  for (i=0;i&lt;scripts.length;i++){
    if(scripts[i] == "something.js"){
      document.getElementsByTagName("script")[i].src = "this.js"
    }
    else {}
  }} 
  </code></pre>