Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<select name="select">
<option>aardvark</option>
<option>butterfly</option>
<option>cockatoo</option>
<option>dingo</option>
<option>elephant</option>
<option>fish</option>
<option>goanna</option>
<option>hippopotomus</option>
</select>
<html>
<head>
<script>
// String variable to hold the letters typed
var lettercache = new String();
// Variable to pass timeouts around on
var ID;
// Clears the letters typed
function clearCache(){
lettercache = new String();
}
//ensures the letters are reset on load
function doOnLoad(){
ID = window.setTimeout('clearCache();' , 2000);
}
//handles keypresses, checks to see if there is a match in the list
function doOnKeyPress(){
window.clearTimeout(ID);
s=window.event.keyCode;
lettercache = lettercache + String.fromCharCode(s);
var obj = document.all.select1;
var selIndx = 0;
for(i = 0; i < obj.options.length; i++) {
str1 = obj.options[i].text.slice(0, lettercache.length);
str2 = lettercache;
if(str1.toUpperCase() == str2.toUpperCase()){
selIndx = i;
break;
}
}
obj.selectedIndex = selIndx;
ID = window.setTimeout('clearCache();' , 2000);
}
</script>
</head>
<body onLoad="doOnLoad()" onKeyPress="doOnKeyPress()">
<form name="form1" method="post" action="">
<select name="select1">
<option>aardvark</option>
<option>abba</option>
<option>accent</option>
<option>access</option>
<option>accessed</option>
<option>adventure</option>
<option>aeroplane</option>
<option>afternoon</option>
<option>afterwards</option>
</select>
</form>
</body>
</html>