title: Javascript check if input is a specific string
body: <p>I have an HTML Input field and I need javascript to check if the input entered into this box is a certain string. Specifically, it has to be a specific Zip code, there are a total of 9 different zip codes, all which are different and in no numerical order. Once the code checks if it is that specific zip code, it returns "Yes", if not, simply no.</p>
  
  <p>I know how to do this with ints, as shown in the code below, but not sure to how to do this with strings. This is my current code, which works with validating an integer between 1-10:</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-html lang-html prettyprint-override"><code>&lt;input id="numb"&gt;
  
  &lt;button type="button" onclick="myFunction()"&gt;Submit&lt;/button&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  function myFunction() {
      var x, text;
  
      // Get the value of the input field with id="numb"
      x = document.getElementById("numb").value;
  
      // If x is Not a Number or less than one or greater than 10
      if (isNaN(x) || x &lt; 1 || x &gt; 10) {
          text = "Input not valid";
      } else {
          text = "Input OK";
      }
      document.getElementById("demo").innerHTML = text;
  }
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>