python :开关,开灯关灯

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Title</title>
    <style >
        .hide{
            display:none
        }
    </style>

</head>
<body>
<input id=22 type="button" value="开关"/>
<div class="a hide">fffff</div>
<script src="jquery-1.12.4.js"></script>
<script>
//  点击按钮如果有hide 就移除,如果没有就加上hide
//    $('#22').click(function () {
//        if ($('.a').hasClass('hide')){
//             $('.a').removeClass('hide')
//        }else
//        $('.a').addClass('hide')
//    })

$("#22").click(function () {
     $('.a').toggleClass('hide')
})
//toggleClass有的话我你去的,没有的加上
</script>
</body>
</html>
开关
disabled文本框置灰
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Title</title>
</head>
<body>
<div>
-- disabled文本框置灰
    <input type="text" disabled/>
</div>
</body>
</html>
disabled文本框置灰
原文地址:https://www.cnblogs.com/xuehuahongmei/p/6123872.html