当我想重复在文本域输入相同数据时,文本域自动会显示一个像下拉菜单一样的叫什么?
当我想重复在文本域输入相同数据时,文本域自动会显示一个像下拉菜单一样的历史记录,这个历史记录叫什么?
程序代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
*{margin:0; padding:0; font-size:12px}
input{width:180px; border:1px solid #ccc; height:22px; line-height:22px}
#Suggest{width:180px; position:absolute; border:1px solid #ddd; background-color:#ccc; color:#f00; display:none}
#Suggest span{width:180px; height:22px; float:left}
</style>
<script>
/*
* 获取对象
*/
$ = function(id) {return typeof id == 'string' ? document.getElementById(id) : id};
/*
* 用法 getPost($('obj'), 'Left') 相对与 $('obj')的Left Top类似
*/
function getPos(el,ePro){
var ePos=0;
while(el!=null)
{
ePos+=el["offset"+ePro];
el=el.offsetParent;
}
return ePos;
};
/*
* 测试函数
*/
Show = function(obj) {
$('Suggest').style.display = 'block';
$('Suggest').style.left = getPos(obj, 'Left') + 'px';
$('Suggest').style.top = (getPos(obj, 'Top') + 26) + 'px';
};
</script>
</head>
<body>
<div id="Suggest">
<span>数据一</span>
<span>数据一</span>
<span>数据一</span>
<span>数据一</span>
<span>数据一</span>
</div>
<div style="width:500px; margin:10px auto">
<input type="text" onclick="Show($(this))" />
</div>
</body>
</html>