首页 > 其他 > 详细

焦点聚焦失焦默认值显示隐藏

时间:2017-08-10 19:02:24      阅读:252      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<input type="checkbox" name="">
<input type="checkbox" name="">
<input type="checkbox" name="">
<input type="text" name="" value="请填写...">
    
</body>
<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
<script type="text/javascript">
    $(function(){
        $("input[type=‘checkbox‘]").prop("checked",true);
        $("input[type=‘checkbox‘]:eq(2)").prop("disabled",true);
        $(input[type=text]).focus(function(){
            var mozhi=$(this).val();
            if(mozhi==请填写...){
                $(this).val(‘‘)
            }
        });
        $(input[type=text]).blur(function(){
            var thisval=$(this).val();
            if(thisval==‘‘){
                $(this).val("请填写...");
            }
        })

    })
</script>
</html>

 

焦点聚焦失焦默认值显示隐藏

原文:http://www.cnblogs.com/jinsuo/p/7340788.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!