Javascript onKeyUp
<p>so I'm working on a mock version of google censorship for history class. I'm trying to get the search to work upon pressing enter, but so far all I get is a search upon the first letter I enter. Any suggestions? </p>

<p>HTML code: </p>

<pre><code>&lt;form id="searchBox"&gt;
    &lt;input type="text" id = "search" name="search" size="85" onKeyUp="searchCensor()"/&gt;&lt;br /&gt;        
&lt;/form&gt;
</code></pre>

<p>JavaScript Code: </p>

<pre><code>function searchCensor() 
{
    var keyTerms = document.getElementById("search").value;
    if(keyTerms == "censorship")
        window.location = "http://andrewgu12.kodingen.com/history/censor.php";
    else if(window.event.keyCode == 13)
        window.location = "https://www.google.com/search?q="+keyTerms;
    else 
        window.location = "https://www.google.com/search?q="+keyTerms;
}
</code></pre>
