22 lines
666 B
JavaScript
22 lines
666 B
JavaScript
function openTab(tabName,elmnt,color) {
|
|
var i, tabcontent, tablinks;
|
|
tabcontent = document.getElementsByClassName("tabcontent");
|
|
for (i = 0; i < tabcontent.length; i++) {
|
|
tabcontent[i].style.display = "none";
|
|
}
|
|
tablinks = document.getElementsByClassName("tablink");
|
|
for (i = 0; i < tablinks.length; i++) {
|
|
tablinks[i].style.backgroundColor = "";
|
|
}
|
|
document.getElementById(tabName).style.display = "block";
|
|
if(elmnt.style != null) {
|
|
elmnt.style.backgroundColor = color;
|
|
}
|
|
}
|
|
|
|
window.onload = function() {
|
|
openTab('tabintro', this, '#222');
|
|
}
|
|
|
|
/* Javascript sure is neat. Anyways part 3/3 of the flag: _lucky?832b0699} */
|