In jquery ui demo, id selectors are used to link to a specific tab, which work fine in links, since "#" denotes the anchor in the link.
However, I want to create several tabs and associate them with the corresponding tabs using the class selector.
<div class="accordion">
<h3>Product x</h3>
<div class="tabs">
<ul>
<li><a href=".tabs-0">General product info</a></li>
<li><a href=".tabs-1">End user info</a></li>
</ul>
<div class="tabs-0">
general info for product x.
</div>
<div class="tabs-1">
end user info product x.
</div>
</div>
</div>
<div class="accordion">
<h3>Product y</h3>
<div class="tabs">
<ul>
<li><a href=".tabs-0">General info</a></li>
<li><a href=".tabs-1">End user info</a></li>
</ul>
<div class="tabs-0">
general info for product y.
</div>
<div class="tabs-1">
end user info product y.
</div>
</div>
</div>
Here it is what I tried in jsfidlle and here how each panel should look!
So the question is, how can I refer to tabs by class name?
source
share