title: Search form input - Search "as you type" with HTML/Javascript
body: <p>I have following search form in an HTML page on website built with Django:</p>
  <pre><code>&lt;form method=&quot;get&quot;&gt;
  &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;q&quot; id=&quot;id_q&quot; placeholder=&quot;Search...&quot;&gt;
  &lt;/form&gt;
  </code></pre>
  <p>I would like it to perform a search while typing (not having to press enter). I know we could use <strong>onchange</strong> or <strong>onkeyup</strong>, but I don't seem to be able to make it work.</p>
  <p>The javascript at the bottom of the page is as follows:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
  document.getElementById(&quot;id_q&quot;).value = &quot;{{query}}&quot;
  &lt;/script&gt;
  </code></pre>
  <p>Edit: I saw that my search works without the Javascript part above, but I still need to press on Enter. What would be a simple script to launch the search &quot;as you type&quot; without pressing Enter?</p>