JS文本框默认值处理详解

时间:2013-07-10    点击:76   

复制代码 代码如下:

<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>

js Map List 遍历使用示例
JS getAttribute和setAttribute(取得和设置属性)的使用介绍
JS下拉框内容左右移动效果的具体实现
解析dom中的children对象数组元素firstChild,lastChild的使用
关于js遍历表格的实例
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved