标签:style blog http java io 2014 ar cti
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>请输入关键字</title>
</head>
<body>
<style>
ul,li{list-style:none;}
</style>
<script language="JavaScript">
function show(){
var val = document.getElementsByTagName("input");
var oUl = document.getElementsByTagName("ul");
if (val[0].value !=‘‘)
{
val[0].value =‘‘;
oUl[0].style.display="block";
}
}
function hide(){
var val = document.getElementsByTagName("input");
var oUl = document.getElementsByTagName("ul");
if (val[0].value ==‘‘)
{
val[0].value ="请输入关键字";
oUl[0].style.display="none";
}
}
</script>
<input value="请输入关键字"
onfocus="show()"
onblur="hide()" />
<ul style="display:none;">
<li>标题1</li>
<li>标题2</li>
<li>标题3</li>
<li>标题4</li>
</ul>
</body>
</html>
标签:style blog http java io 2014 ar cti
原文地址:http://www.cnblogs.com/moliwanzi/p/3907536.html