Open DinkydauSet opened 3 years ago
By using the attribute "hidden" tabs can also be made with HTML. A test:
<html>
<body>
<script>
window.thehidden = 2;
function onclickfunction() {
if (window.thehidden == 1) {
var elt1 = document.getElementById("1");
var elt2 = document.getElementById("2");
elt1.removeAttribute("hidden");
elt2.hidden = true;
window.thehidden = 2;
}
else {
var elt1 = document.getElementById("1");
var elt2 = document.getElementById("2");
elt2.removeAttribute("hidden");
elt1.hidden = true;
window.thehidden = 1;
}
}
</script>
<div height="100px">
<button onclick="onclickfunction()">
click here
</button>
</div>
<div id="main">
<div id="1" width="100%", height="100%">
<textarea>Input 1</textarea>
</div>
<div id="2" width="100%", height="100%" hidden>
<textarea>Input 2</textarea>
</div>
</div>
</body>
</html>
wanted: