MCPcopy Create free account
hub / github.com/nodejs/node / addTab

Method addTab

deps/v8/tools/turbolizer/src/tabs.ts:52–59  ·  view source on GitHub ↗
(caption: string)

Source from the content-addressed store, hash-verified

50 }
51
52 public addTab(caption: string): HTMLLIElement {
53 const newTab = document.createElement("li");
54 newTab.innerHTML = caption;
55 newTab.id = `tab-header-${this.container.id}-${this.nextTabId++}`;
56 const lastTab = this.tabBar.querySelector("li.last-tab");
57 this.tabBar.insertBefore(newTab, lastTab);
58 return newTab;
59 }
60
61 private makeTabBar(container: HTMLElement): void {
62 container.classList.add("nav-tabs-container");

Callers 2

addTabAndContentMethod · 0.95

Calls 1

createElementMethod · 0.80

Tested by

no test coverage detected