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.
<script language="javascript">
function fillin()
{
var mytext = Mainform.mytext.value;
sellength = Mainform.wholetext.length;
var i;
for(i = 0; i<sellength; i++)
{
if (Mainform.wholetext.options[i].text.toLowerCase().indexOf(mytext.toLowerCase(),0) == 0)
{Mainform.wholetext.options[i].selected = true;
break;}
}
}
function filltext()
{
var selectedItem = Mainform.wholetext.selectedIndex;
var selectedText = Mainform.wholetext.options[selectedItem].text;
Mainform.mytext.value = selectedText;
}
</script>
Here is the HTML section:
<form name = "Mainform">
<input type = "text" name = "mytext" onkeyup = "fillin()">
<select name = "wholetext" onclick = "filltext()">
<option>Red</option>
<option>Red Flowers</option>
<option>Green</option>
<option>Grass</option>
</select>
</form>