title: How can I detect for input on my "Terminal" like html script?
body: <p>I have written a script in html for a &quot;Terminal&quot;.</p>
  <pre><code>&lt;html&gt;
  
    &lt;head&gt;
      &lt;title&gt;Nonscript&lt;/title&gt;
      &lt;div id=&quot;htmlterminal&quot;&gt;
        &lt;center&gt;
          &lt;pre&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |H|T|M|L| |T|E|R|M|I|N|A|L| |M|A|D|E| |B|Y| |M|A|X|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       
       &lt;/pre&gt;
        &lt;/center&gt;
      &lt;/div&gt;
      &lt;style&gt;
        #htmlterminal {
          background: red;
          background: -webkit-linear-gradient(left, orange, yellow, green, cyan, blue, violet);
          background: -o-linear-gradient(right, orange, yellow, green, cyan, blue, violet);
          background: -moz-linear-gradient(right, orange, yellow, green, cyan, blue, violet);
          background: linear-gradient(to right, orange, yellow, green, cyan, blue, violet);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
          font-size: 3vw;
        }
  
        #htmlterminal
  
      &lt;/style&gt;
    &lt;/head&gt;
  
    &lt;body style=&quot;background-color:Black;&quot;&gt;
      &lt;p id=&quot;welcome&quot; , style=&quot;color:white&quot;&gt;Hello welcome to the HTML Terminal, for a list of commands type &quot;help&quot;.&lt;/p&gt;
      &lt;center&gt;
        &lt;form class=&quot;pure-form&quot;&gt;
          &lt;input id=&quot;command_prompt&quot; type=&quot;text&quot; placeholder=&quot;Enter command&quot; /&gt;
          &lt;button type=&quot;submit&quot;&gt;Run&lt;i class=&quot;fa fa-chevron-circle-right&quot;&gt;&lt;/i&gt;&lt;/button&gt;
        &lt;/form&gt;
      &lt;/center&gt;
      &lt;p id=&quot;return&quot; , style=&quot;color:white&quot;&gt;&lt;/p&gt;
      &lt;script&gt;
        var commandPrompt = document.getElementById('command_prompt');
  
        document.querySelector('form.pure-form').addEventListener('submit', function(e) {
  
  
          e.preventDefault();
  
          document.getElementById(&quot;return&quot;).innerHTML = &quot;Executing: &quot; + commandPrompt.value;
        });
  
      &lt;/script&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  <p>And I have tried using <code>if</code> to check for input but it dosent seem to be working, here is my code:</p>
  <pre><code>if commandPrompt.value = &quot;help&quot; {
    document.getElementById(&quot;return&quot;).innerHTML = &quot;Some more commands come here&quot;
  }
  else{
  return null
  }
  </code></pre>
  <p>I have browsed the web but I still havent found anything, may I get some help?,</p>
  <p>Thanks, Blitzel</p>