function autoComplete(aID, aGlobalName){ this.inputID = aID; this.inputElm = document.getElementById(this.inputID); this.globalName = aGlobalName; // generate the autocomplete div var myElm = window.document.createElement("div"); this.acElm = myElm; //this.acElm.style.visibility = "hidden"; this.acElm.style.border = "1px solid black"; this.acElm.style.padding = "50px"; this.acElm.style.left = "0px"; this.acElm.style.top = "100px" this.inputElm.onkeypress = this.keyPress; } autoComplete.prototype.keyPress = function acKeyPress(aEvent){ this.acElm.style.visibility = "visible"; }