MediaWiki:Gadget-Tabs.js

$(document).ready(function{	// When a tab is clicked	$(".tab").click(function { var $siblings= $(this).parent.children; var $alltabs = $(this).closest(".tabheader"); var $content = $alltabs.parent.children(".tabcontents");

// switch all tabs off $siblings.removeClass("active"); $content.children.removeClass("content--active");

// switch this tab on		$(this).addClass("active"); var index = $siblings.index(this); $content.children.eq(index).addClass("content--active"); }); });