title: Is there a way to get text from a html textbox using js?
body: <p>Now, I know this has been posted before. Read it before reporting. I want to try and make a script that gets text from a textbox, and the textbox has code that the user writes. Right now I have a script that can open it in a new window, but</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  const el = document.getElementById('externalLink');
  
    // Create a content for a new page with a script in it
    const newPageContent = `
  &lt;DOCTYPE html&gt;
  &lt;head&gt;
  &lt;title&gt;some code&lt;/title&gt;
  &lt;/head&gt;
  &lt;body contenteditable&gt;
  &lt;h1&gt;Some editable text&lt;/h1&gt;
  &lt;/body&gt;
    `;
  
    // Listen on "click" event
    el.addEventListener('click', (e) =&gt; {
      e.preventDefault();
  
      // Create a new window on click
      const w = window.open('', '_blank');
  
      // Write your content to it
      w.document.write(newPageContent);
    });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- Your link !--&gt;
  &lt;a id="externalLink" href="#/"&gt;Click to run the code&lt;/a&gt;
  &lt;br&gt;
  &lt;input type="text" name="Codebox" value="Code here..."&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>But the script &quot;<code>var Codebox = document.getElementsByName('txtJob')[0].value</code>&quot; just gets run as a html script, thus makeing it literally say &quot;var Codebox = document.getElementsByName('txtJob')[0].value&quot; on the result page. If there is a way to bypass this, or if i'm just doing it incorrectly, could someone please help me? That would be great! :)</p>