title: jQuery works between <script> tags but not in a .js file
body: <p>I'm having trouble to understand why following code is working between script-tages in a html file, but not in a js-file. </p>
  
  <p><strong>I have refereced my javascript file as followed and imported jQuery</strong></p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="./../js/app.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p><strong>This is working</strong></p>
  
  <pre><code>&lt;html&gt;
  ...
  
  &lt;script&gt;
  $("#search").keyup(function() {
      var searchText = $(this).val().toLowerCase();
  
      $.each($("#consumerDetails tbody tr"), function() {
          if ($(this).text().toLowerCase().indexOf(searchText) === -1)
              $(this).hide();
          else
              $(this).show();
      });
  });
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Everything works fine in app.js, exept the just mentioned code. But if I put it between the script tags, in my html code, it works?! </p>
  
  <p>Why does my code works between the script tags but not in my javascript file app.js?</p>
  
  <p>Console with f12 is not showing any errors.</p>