I am looking for a fairly simple solution to show and hide lang="" specified DIV's (a switcher between the two). This must not be too hard, but I am a beginner in Javascript, and I couldn't find any proper resources. Does anyone have a suggestion?
:lang(eng) {
display: block;
}
:lang(de) {
display: none;
}
button {
width:100px;
height: 50px;
background-color: blue;
}
button: active{
background-color: green;
}
#example :lang(eng){
width: 100vw;
text-align: center;
height: 50vh;
background-color: yellow;
}
#example :lang(de){
width: 100vw;
text-align: center;
height: 50vh;
background-color: red;
}
<button onclick="myFunction()">English</button>
<button onclick="myFunction()">German</button>
<div id="example" lang="eng">
<p>DIV with English text</p>
</div>
<div id="example" lang="de">
<p>DIV with German text</p>
</div>