title: How to use script to change element (with require)
body: <p>I have a script that returns a string (E.G "Lunami's Current Name Is: bigmon)
  I would like the script to run and replace a element in my document (id: replace) but its not working and gives me this error? Is there any way I can get this to work?</p>
  
  <p><a href="https://i.stack.imgur.com/n402n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n402n.png" alt="enter image description here"></a></p>
  
  <p>Note: leaguejs is a npm pacakge</p>
  
  <h2>Code</h2>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var Leaguejs = require('leaguejs')
  const leaguejs = new Leaguejs("KEY!123123123");
  
  var summonerId = 'EXzNQLirRTxF_-l5-MYhE0RN-1i5rO-TDmHmdEzgf3psI94'
  var accountId = 'BteGB3awYZqnAzYXnR2Bfo9NcqxvbP4DW-tsvJ5LR_u9rejnu2ArF5Gc'
  var documentToChange = document.getElementById("replace")
  
  leaguejs.Summoner.gettingById(summonerId, 'oce').then(data =&gt; {
      leaguejs.Summoner.gettingById(summonerId, 'oce').then(data =&gt; {
          documentToChange.innerHTML = `Lunami's Current Username Is: "${data.name}"`
      }).catch(err =&gt; {
          leaguejs.Summoner.gettingByAccount(accountId, 'oce').then(datE =&gt; {
              documentToChange.innerHTML = `Lunami's Current Username Is: "${datE.name}"`
          }).catch(err =&gt; {
              documentToChange.innerHTML = "Lunami's Broken ;-;"
          })
      })
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
      &lt;title&gt;Lunami Tracker&lt;/title&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;meta charset="UTF-8"&gt;
  
      &lt;link rel="stylesheet" href="./style.css"&gt;
      &lt;link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700%7CPoppins:400,500" rel="stylesheet"&gt;
  &lt;/head&gt;
  
  &lt;div class="main-area center-text" style="background-image:url(./image.png);"&gt;
      &lt;div class="display-table"&gt;
          &lt;div class="display-table-cell"&gt;
              &lt;h3 class="title font-white" id='replace'&gt;Loading . . .&lt;/h3&gt;
              &lt;p class="desc font-white" id="trackMsg"&gt;&lt;/p&gt;
              &lt;ul class="social-btn1 font-white"&gt;
                  &lt;li&gt;&lt;a href="https://discord.gg/Guc7rkZ"&gt;Discord&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="https://www.twitter.com/whynotbefriends"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="https://www.twitch.tv/whynotbefriends"&gt;Twitch&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;script src="index.js"&gt;&lt;/script&gt;
      &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>After using <code>Import Leaguejs from 'leaguejs'</code>
  I get this error</p>
  
  <pre><code>Access to script at 'file:///home/alphamale/index.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
  </code></pre>