Jquery UI disable dynamic tabs <p>My UI tabs can change based on user action (example - a status message may appear in tab[0]). </p> <p>I also need to be able to disable specific tabs - I know the href, but the index may well change.</p> <p>The UI dox say that you can pass a href instead of an index, but I can't seem to get that to fly.</p> <p>This is what I am doing instead:</p> <pre><code>var disableSlots = []; $('ul.ui-tabs-nav li').each(function(index, el){ if ($(this).children('a').attr('href') == '#DISABLE_ME'){ disableSlots.push(index); } }); $('#tabs').tabs("option","disabled",disableSlots); </code></pre> <p>Is there a better way?</p>