ok, I have a input type="text" and when I type in it, I want my div to follow the exact value of my input. However, my div is always one character back. So If I type "ARGH" ... my div says "ARG"

the form
Code:
<form action="" method="post">
<input id="searchtext" type="text" value="" onkeypress="autocomplete(this.value, event);">
</form>
the js function
Code:
function autocomplete(thevalue, e) {

theObject = document.getElementById("superdiv");

var key = e.which

if(key == undefined){
key = e.keyCode;  
}

theObject.innerHTML = thevalue;

}