Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript hide two element and show only one

Tags:

jquery

Hi all I have this script and i want when I click GE show EN and RU,after click EN then show RU and GE only, I want it's happened Toggle times

   <script>
    $(document).ready(function(){
        $(".content").click(function(){

        });
    });
</script>

<style>
    .lang1{
        display:none;
    }
</style>

</head>

<body>
    <div class="content">GEO</div>
    <div class="lang1">EN</div>
    <div class="lang1">RU</div>
</body>
like image 304
user3844078 Avatar asked Feb 12 '23 08:02

user3844078


1 Answers

Its so easy

 <body>
        <div class="second">GEO</div>
        <div class="second">EN</div>
        <div class="second">RU</div>
    </body>

    // language panel script 
    <script>
    $(".second").click(function(){
        $(".second").not(this).fadeToggle();
        });
    </script>
like image 102
Val Do Avatar answered Feb 14 '23 23:02

Val Do