码迷,mamicode.com
首页 > 其他好文 > 详细

开关 toggleClass('hide')

时间:2018-07-14 16:33:00      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:cli   splay   value   type   oct   toggle   col   round   utf-8   

toggleClass 实现属性的反转

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .hide{
            display: none;
        }
    </style>
</head>
<body>
    <div class="hide">asdads</div>
    <input id="i1" type="button" value="开关">
<script src="../jquery-2.12.4.js"></script>
<script>
    $(#i1).click(function () {
        $(div).toggleClass(hide)
    })
</script>
</body>
</html>

 

开关 toggleClass('hide')

标签:cli   splay   value   type   oct   toggle   col   round   utf-8   

原文地址:https://www.cnblogs.com/my-love-is-python/p/9309631.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!