if (!getobj(inputid+"mydiv")){//若尚未创建就建之
var divcss="font-size:12px;color:#00f;position:absolute;left:"+(getobj(inputid).offsetLeft+0)+"px;top:"+(getobj(inputid).offsetTop+25)+"px;border:1px solid red"
crertdiv("","div",inputid+"mydiv",divcss);//创建层"mydiv"
//alert(document.getElementById("mydiv").outerHTML)
crertdiv(inputid+"mydiv","ul",inputid+"myul");//创建ul
for (var i=0,j=text_list.length;i
getobj(inputid+"li"+i).innerHTML=text_list;}crertdiv(inputid+"myul","li",inputid+"li"+j,"color:#f00;background:#fff");//创建"clear"li
getobj(inputid+"li"+j).innerHTML="clear";
getobj(inputid+"mydiv").innerHTML +="for (var i=0;i<=j;i++){
getobj(inputid+"li"+i).onmouseover=function(){this.style.background="#eee";clearTimeout(timer)}
getobj(inputid+"li"+i).onmouseout=function(){this.style.background="#fff"}}}var newdiv=getobj(inputid+"mydiv")
newdiv.onclick=function(){hiddiv(event,inputid);}
newdiv.onmouseout=function(){Mout(this)}
newdiv.onmouseover=function(){clearTimeout(timer)}
getobj(inputid).onmouseout=function(){Mout(newdiv)}
newdiv.style.display="block";swtemp=1;objtemp=inputid;}var timerfunction Mout(o){
timer=setTimeout(function(){o.style.display="none";},300)swtemp=0;}function hiddiv(e,inputid){
e=e||window.event;
ev=e.target||e.srcElement;
v=ev.innerText||ev.textContent;
if (v!="clear")getobj(inputid).value=v;else getobj(inputid).value=""
getobj(inputid+"mydiv").style.display="none";}....利用定义标签赋值....(onclick)........利用定义js变量赋值...(onclick)........利用隐藏域值赋值....(onmouseover).....