復制代碼 代碼如下:
<script type="text/javascript">
function txtFocus(el) {
if (el.defaultValue == el.value) { el.value = ''; el.style.color = '#000'; }
}
function txtBlur(el) {
if (el.value == '') { el.value = el.defaultValue; el.style.color = '#666'; }
}
</script>
<asp:TextBox ID="txtBookPerson" runat="server" CssClass="text2" style="color:#666;" onfocus="txtFocus(this)" onblur="txtBlur(this)" value='請輸入預定人' ></asp:TextBox>