Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →jQuery UI Tabs turns a list of linked tab labels into a single content area whose panels can be local elements or loaded remotely. Build the required list-and-panel markup, call .tabs(), then configure activation, the active index, collapsing, keyboard behavior, height, effects, and events through the widget API.
This guide covers the current API terminology. Check the jQuery UI Tabs API for the version installed in your project; the official demo currently references jQuery 3.7.1 and jQuery UI 1.14.2, but those demo assets do not guarantee compatibility with every application stack.
What jQuery UI Tabs expects
Tabs are a widget, not just a CSS pattern. The labels must be in an ordered or unordered list. Each label is an <li> containing an anchor with an href. For an in-page panel, the anchor fragment must match that panel’s id. The panels may be otherwise valid HTML elements.
<div id="account-tabs">
<ul>
<li><a href="#profile-panel">Profile</a></li>
<li><a href="#security-panel">Security</a></li>
</ul>
<section id="profile-panel">
<h3>Profile</h3>
<p>Profile fields go here.</p>
</section>
<section id="security-panel">
<h3>Security</h3>
<p>Security settings go here.</p>
</section>
</div>
<script>
$(function () {
$("#account-tabs").tabs();
});
</script>
Load jQuery and jQuery UI (including the UI CSS) before this initialization. If an anchor points to an element that does not exist, the local panel relationship is broken; check the fragment and id character-for-character.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problems#1 Best Overall
Local panels and Ajax-loaded panels
In-page content
A fragment such as #profile-panel selects content already present in the document. This is the simplest option and keeps all panel markup in the initial page.
Remote content
The API also supports remote panels. Give a tab anchor a URL rather than an in-page fragment, and jQuery UI Tabs uses that URL for Ajax loading. Remote loading has its own beforeLoad and load events, and the widget exposes a load method.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
<div id="reports-tabs">
<ul>
<li><a href="reports/summary.html">Summary</a></li>
<li><a href="reports/detail.html">Details</a></li>
</ul>
</div>
<script>
$("#reports-tabs").tabs({
beforeLoad: function (event, ui) {
// Cancel a request when application conditions require it.
// ui.jqXHR.abort();
},
load: function (event, ui) {
// ui.panel contains the loaded panel.
}
});
</script>
Keep the remote endpoint on the same origin or configure the server and browser for the required cross-origin policy. Handle authorization, errors, and loading states in your application rather than assuming every request succeeds.
Choose activation and panel behavior
| Decision | Configuration | Behavior |
|---|---|---|
| Open one tab initially | active: 0 (zero-based) |
Opens the first tab; use another index for a different initial panel. |
| Start with no panel | collapsible: true and active: false |
Allows all panels to be closed initially. |
| Disable tabs | disabled: true or an array of tab indexes |
Disables every tab or only the listed indexes. |
| Activation trigger | Default event: "click"; optionally event: "mouseover" |
Chooses whether activation follows a click or pointer hover. |
| Panel height | heightStyle: "content", "auto", or "fill" |
Uses each panel’s content height, a common calculated height, or available filled height. |
| Transition | show and hide |
Applies configured show/hide effects when panels change. |
$("#account-tabs").tabs({
active: 1,
collapsible: true,
disabled: [2],
event: "click",
heightStyle: "auto",
show: { effect: "fade", duration: 150 },
hide: { effect: "fade", duration: 150 }
});
The best height mode depends on the surrounding layout. content avoids forcing short panels to match a tall one; auto gives panels a common calculated height; fill is intended when the tabs should consume the available height of their container.
Rank #3
Keyboard access and focus
jQuery UI Tabs provides keyboard interaction in addition to pointer activation. Users can move among tabs with the arrow keys, jump to the first or last tab with Home and End, and activate the focused tab with Space or Enter. The API also documents modified key combinations for tab navigation. Do not describe this widget as mouse-only, and keep visible focus styling in your theme.
React to activation and creation events
Cancel or inspect a pending change
beforeActivate runs immediately before a tab is activated and can cancel the change. Use it for validation or an unsaved-changes decision.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
$("#account-tabs").tabs({
beforeActivate: function (event, ui) {
if (ui.newTab.data("requires-confirmation") && !window.confirm("Continue?")) {
event.preventDefault();
}
}
});
Run code after activation
activate runs after activation and any configured animation. It does not fire for the initial tab during widget creation. Use create when initialization itself must trigger code.
$("#account-tabs").tabs({
create: function (event, ui) {
// Runs when the widget is created.
},
activate: function (event, ui) {
// Runs after a later tab change.
}
});
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Change tabs after initialization
Use the widget method form to read or change options and to refresh the tab set:
Recommended Free Tools
Best Value
var tabs = $("#account-tabs").tabs();
// Read the current zero-based active index.
var current = tabs.tabs("option", "active");
// Activate the third tab.
tabs.tabs("option", "active", 2);
// Add or remove tab markup, then ask the widget to reprocess it.
tabs.tabs("refresh");
refresh() processes tabs added to or removed directly from the DOM and recomputes panel heights. Call it after changing the markup rather than expecting the widget to detect arbitrary DOM edits automatically.
Common implementation failures
- Panel never appears: verify that a local anchor such as
#security-panelhas exactly one matchingid="security-panel". - Wrong tab opens: remember that
activeis zero-based, so0means the first tab. - All panels cannot be closed: set
collapsible: true; settingactive: falsealone is not sufficient. - New tabs are ignored: add the markup, then call
refresh(). - Code does not run on the first panel: bind initialization logic to
create;activateis for subsequent activation. - Ajax tab stays empty: inspect the network response, URL, permissions, and same-origin or CORS configuration, then use
beforeLoadandloadto observe the request lifecycle.
Appearance and supported examples
The widget’s visual presentation comes from jQuery UI’s CSS and theme classes; you can override those styles to match your application without changing the tab contract. The official jQuery UI Tabs demo shows default tabs, collapsible content, Ajax content, mouseover activation, dynamic manipulation, sortable tabs, and vertical tabs.
For projects pinned to older releases, compare the versioned references for jQuery UI 1.11 Tabs and jQuery UI 1.10 Tabs with the current Tabs API before relying on an option or event.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




