<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
window.onload=function(){
var li = document.getElementsByTagName("li");
for(var i = 0 ; i < li.length ; i ++){
li[i].onmouseover = function(){
this.style.backgroundColor = "#F90";
}
li[i].onmouseout = function(){
this.style.backgroundColor = "";
}
li[i].onclick = function(){
var msg = this.innerText;
var input = document.getElementById("ipt");
var cot = input.value;
input.value = cot + msg ;
document.getElementById("_ul").style.display="none";
}
}
document.getElementById("ipt").onkeyup = function(){
document.getElementById("_ul").style.display="";
if(document.getElementById("ipt").value == ""){
document.getElementById("_ul").style.display="none";
}
}
}
</script>
<title>邮箱</title>
</head>
<body>
<div id="panel">
<input id="ipt" type="text" />
<!--onmouseover="over(this)" onmouseout="out(this)" onclick="click(this)"-->
<ul id="_ul" style="display:none">
<li>@qq.com</li>
<li>@sohu.com</li>
<li>@163.com</li>
<li>@baidu.com</li>
</ul>
</div>
</body>
</html>
------解决方案--------------------
哥们,这么晚还在上班,小心身体呀,火狐对 innerText好像不支持的,改成innerHTML就好啦
//var msg = this.innerText;
var msg = this.innerHTML;