I have a problem with my code, I don't know why it doesn't work. My goal is to have my default:
EN div with only #en div visible, FR & DE id must be hidden by default.
When we click on FR or DE, we have only #fr or #de visible and the rest hidden.
HERE IS MY JSFIDDLE
HERE IS MY CODE:
$('#en').click(function(){
$('fr[id^=fr], de[id^=de]').hide();
$('#en1, #en2').show();
});
$('#fr').click(function(){
$('en[id^=en], de[id^=de]').hide();
$('#fr1, #fr2').show();
});
$('#de').click(function(){
$('fr[id^=fr], en[id^=en]').hide();
$('#de1, #de2').show();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a class="button" id="en">EN</a>
<a class="button" id="fr">FR</a>
<a class="button" id="de">DE</a>
<div id="en1">1</div>
<div id="fr1">2</div>
<div id="de1">3</div>
<div id="en2">4</div>
<div id="fr2">5</div>
<div id="de2">6</div>
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>on top of your html. Here is source of this