ASP.NET 一控件Textbox 在 Textbox 中输入一行字,怎样实现当鼠标点击Textbox时,这里面的字消失 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 失去焦点的客户端事件是 onblur 用JS实现JQuery实现$("#textBox1").click(function(){$(this).text("");}) <asp:TextBox id="o" value="请输入搜索关键字" />document.onkeydown=function(){ if(event.keyCode=="13") { var user = ''; if (user=="") { if (document.getElementById("o").value=="请输入搜索关键字") { document.getElementById("Button2").click(); return false; }else { document.getElementById("btnQSearch").click(); return false; } }else { if (document.getElementById("o").value=="请输入搜索关键字"||document.getElementById("o").value=="") { alert("请输入搜索关键字"); return false; } } } } onclick onfocus 都可以 <asp:TextBox ID="TextBox1" runat="server" value="想找什么?输入名称试试" onfocus="if(value=='想找什么?输入名称试试'){value=''}" onblur="if(value==''){value='想找什么?输入名称试试'}" ></asp:TextBox> onfocus="if (this.value=='请输入') this.value=''" onblur="if(this.value=='') this.value='请输入'" 跨表查询 model赋值问题 防止SQL注入问题 ajaxpro2的使用问题 问个问题,一直没能想出这个是根据什么原理做的 请教一个批量修改SQL数据库的SQL语句 求在线支付代码, framework1.1下的 怎样替换重复的<br>为一个??????? REPORTING SERVICES 分页的问题 如何让window.open打开的页面获得原页面的cookies? ADO.net不能用这是为什么? 母版页的问题. 求一正则表达式
JQuery实现
$("#textBox1").click(function(){
$(this).text("");
})
if(event.keyCode=="13")
{ var user = '';
if (user=="")
{
if (document.getElementById("o").value=="请输入搜索关键字")
{
document.getElementById("Button2").click();
return false;
}else
{
document.getElementById("btnQSearch").click();
return false;
}
}else
{
if (document.getElementById("o").value=="请输入搜索关键字"||document.getElementById("o").value=="")
{
alert("请输入搜索关键字");
return false;
}
}
}
}
onfocus="if (this.value=='请输入') this.value=''" onblur="if(this.value=='') this.value='请输入'"