Last active
November 9, 2018 04:26
-
-
Save lukekrikorian/8e0c7c3079d9fdb1e667c2ce86a81cf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const enum TAB { | |
inactive = "link_1uvuyao-o_O-tabTrigger_pbokdw-o_O-inactiveTab_1t8hj6j", | |
active = "link_1uvuyao-o_O-tabTrigger_pbokdw-o_O-activeTab_t62l0x" | |
} | |
const sectionLink = document.createElement("a"); | |
sectionLink.className = TAB.inactive; | |
sectionLink.setAttribute("role", "tab"); | |
sectionLink.setAttribute("aria-selected", "false"); | |
sectionLink.href = "javascript:void(0)"; | |
sectionLink.textContent = "Statistics"; | |
sectionLink.addEventListener("click", e => { | |
const activeTab = document.getElementsByClassName(TAB.active)[0]; | |
if (!activeTab) { return; } | |
activeTab.setAttribute("aria-selected", "false"); | |
activeTab.className = TAB.inactive; | |
e.srcElement!.className = TAB.active; | |
const tabContent = document.querySelector(".tabContent_8fl3ak"); | |
if (!tabContent) { return; } | |
tabContent.innerHTML = ""; | |
tabContent.innerHTML = "<p>epic..</p>"; | |
}); | |
document.querySelector(".tabRow_2gx8tz")!.appendChild(sectionLink); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment