jquery hide object code example

Example: save action hide element in jquery

<html>
<head>
<script
  src="https://code.jquery.com/jquery-3.1.1.min.js"
  integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
  crossorigin="anonymous"></script>
<script src="../js.cookie.js"></script>
</head>
<body>
    <button id='clckced'> removeCount</button>
    <div id="RemoveCount">
    This should be removed.
    </div>
    <script>
        $(function(){
            if (Cookies.get('RemoveCount') == 'true' && Cookies.get('RemoveCount') != 'undefined' ){
                $("#RemoveCount").hide();
                } else {
                    $("#RemoveCount").show();
                }
            $('#clckced').click(function(){
                Cookies.set('RemoveCount', 'true');
                $("#RemoveCount").hide();
            })
        });
    </script>

</body>
</html>