复制代码 代码如下:
<script type="text/javascript">
var watermarkText = "输入名称";
function WaterMarkOnBlur(textbox) {
if (textbox.value.length == 0) {
textbox.style.color = "gray";
textbox.value = watermarkText;
}
}
function WaterMartOnfocus(textbox)
{
if (textbox.value == watermarkText) {
textbox.style.color = "black";
textbox.value = "";
}
}
</script>
复制代码 代码如下:
<asp:TextBox runat="server" Text="输入名称"
ForeColor="Gray" onblur="WaterMarkOnBlur(this);"
onfocus="WaterMartOnfocus(this);">
</asp:TextBox>
新闻热点
疑难解答
图片精选