<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type="text/javascript">
function getArr(s,arrValue){
var arrResult=new Array();
if(s!=""){
for(var i=0;i<arrValue.length;i++){
if(arrValue[i].indexOf(s)==0){
arrResult.push(arrValue[i]);
}
}
}
return arrResult;
}
window.onload=function (){
document.getElementById("ww").style.display="none";
}
function g(){
var aa=document.getElementById("Text1").value.toLowerCase();
if(aa=="") return;
var arr=["red","orange","yellow","green","blue","indigo","violet","brown","black","tan","ivory","navy","aqua","white","purple","pink","gray","silver"];
arr.sort();
var arrResult=getArr(aa,arr);
var ww=document.getElementById("ww");
ww.options.length=0;
for(var i=0;i<arrResult.length;i++){
ww.options.add(new Option(arrResult[i],arrResult[i]));
}
document.getElementById("ww").style.display="";
}
function t(){
document.getElementById("ww").style.display="none";
}
</script>
</head>
<body>
<form id="form1">
<div>
<input id="Text1" style="width: 174px" onkeyup="g();" onfocus="g();" onblur="t();" type="text" /><br />
<select id="ww" multiple="multiple" name="ww" style="width: 180px">
</select>
</div>
</form>
</body>
</html>