title: Search for a string from a textbox in a textarea
body: <p>Button – calls a function to determine if
  the string in the textbox is found in the contents of the textarea. Naturally,
  message to the user if the string was found or not.</p>
  
  <p>Those were the instructions given to follow, Im not sure exactly how to do this. Here is what I came up with, I keep getting this console error:</p>
  
  <blockquote>
    <p>TypeError: document.getElementById(...) is null<br>
     file:///........program02javascript/program02script.js<br>
    Line 10</p>
    
    <p>line 10 : var SearchTerm = document.getElementById("text_box_1").value;</p>
  </blockquote>
  
  <p>Here is my HTML: </p>
  
  <pre><code>&lt;div id="requirement #2"&gt;
      &lt;h1&gt;Requirement #2&lt;/h1&gt;
      &lt;form&gt;
          Search For:
          &lt;input type="text" name="text_box_1"&gt;
          &lt;br&gt;
      &lt;/form&gt;
      &lt;textarea id="text_area_3"&gt;&lt;/textarea&gt;
      &lt;button type="button" id="button2" onclick="StringSearch()"&gt;Search&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is my Javascript:</p>
  
  <pre><code>function StringSearch() {
      var SearchTerm = document.getElementById("text_box_1").value;
      var TextSearch = document.getElementById("text_area_3").value;
  
      if (TextSearch.match(SearchTerm) === "") {
          alert("String Found. Search Complete");
      } else {
          alert("No Data found in Text Area");
      }
  }
  </code></pre>
  
  <p>How can I accomplish this task? I'm not sure I understand completely what to do. I was trying to find some example code but haven't come across anything that's been helpful.</p>