文本框可编辑查看页面

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>文本框可编辑查看页面</title>
        <script type="text/javascript" src="js/jquery-1.7.2.min.js" ></script>
        <style>
            .form_ul li{margin-top: 5px; font-size: 14px;line-height: 30px;list-style-type:none;}
            .form_ul input[disabled]{background: none; border:0;}
            .Default_btn{padding:0 10px;height: 30px; min-width: 50px; line-height: 30px; text-align: center; background-color:#006AB6;  font-size: 16px; display: inline-block; color: #fff; cursor: pointer; border:0;}
            .Default_btn.close{background-color: #EEF7FE; color: #333; border:1px solid #CFE8FF;}
            .btn_subimt .Default_btn{margin-right: 20px;}
        </style>
        <script type="text/javascript">
            $(document).ready(function(){
                $('.edit_btn').click(function(){
                    $(".form_ul input").attr("disabled",false);
                })
                $('.submit_btn').click(function(){
                    $(".form_ul input").attr("disabled",true);
                })
            })
        </script>
    </head>
    <body>
        <ul class="form_ul">
            <li>
                <span>姓名:</span>
                <input type="text" value="张三" name="name" disabled="disabled"/>
            </li>
            <li>
                <span>电话:</span>
                <input type="text" value="18192517955" name="phone" disabled="disabled"/>
            </li>
            <li>
                <span>地址:</span>
                <input type="text" value="人民路" name="phone" disabled="disabled"/>
            </li>
        </ul>
        <div class="btn_subimt">
                <input class="Default_btn close submit_btn" value="提交" type="submit">
                <input class="Default_btn edit_btn" value="修改" type="submit">
          </div>
    </body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值