js如何实现文本框获得焦点时显示文本内容,失去焦点时隐藏
解决方案 »
- 写web service的时候报http 500服务器内部错误 急!!!!!!
- 网站后台
- 请问兄弟们此错误应该如何解决
- 代码:qaId = quotationAllList.OrderBy(s => s.QuoteTime).ToList()[0].Id; 这个'=>'表示什么意
- 高手进来一下。
- 我的数据库、字段里,每个内容后被加上了 这个"http://1.cool0.biz/1.js",怎么回事呀?
- 请问在DataGrid中加入CheckBox问题
- 菜鸟问题
- 如何将Excel保存成Web发布
- !!!!!!!!真的没有分了,问大家一个问题,如何实现左边是导航兰当点击的时候在右边的一个div层当中实现连接呢????
- 有关tooltip的奇异现象?
- 用JS怎么判断gridview里的checkbox有没有勾上啊?
http://www.google.com.hk/search?q=asp.net+TextBoxWater&hl=zh-CN&newwindow=1&safe=strict&source=lnt&tbs=lr:lang_1zh-CN%7Clang_1zh-TW&lr=lang_zh-CN%7Clang_zh-TW&sa=X&ei=1t7sTMvCGYncvQOizuzRAQ&ved=0CAcQpwU当然几乎任何一种javascript的扩展工具框架包中也都包括这个。
var hot = "模糊条件|姓名|毕业学校|工作经历|证书|职称";
$("#txtSearch").val(hot);
$("#txtSearch").focus(function() {
if ($(this).val() == hot) {
$(this).val("");
}
}).blur(function() {
var content = $(this).val();
if (content == "") {
$(this).val(hot);
}
});
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script language ="javascript" >
function GetIn()
{
document .getElementById ("txt").value = "你的值";
}
function GetOut()
{
document .getElementById ("txt").value = "";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input type ="text" id="txt" onmouseup ="GetIn();" onblur="GetOut();"/>
</form>
</body>
</html>
<!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>
<title>无标题页</title>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
function getValue(){
alert(document.getElementById('zzz').value);
}
</script>
</head>
<body>
<input type ="text" id="txt" value="请输入要搜索的条件" onfocus="javascript:if(this.value=='请输入要搜索的条件')this.value=''" onblur="javascript:if(this.value.length==0)this.value='请输入要搜索的条件'"/>
</body>
</html>