是否可以使用Tabs而不使用锚标记和ID?

我想生成动态标签。 所以锚标签不会有id也div标签不会有id。

这是我尝试做但它不起作用。

 $(function () { $("#tabs").tabs(); $("#tabs ul.super li a").each(function (index) { $(this).click(function () { $("#tabs").tabs("select", index); }); }); });  
content1
content2

我怎么能让它像那样工作?

这是workind代码。 动态添加标签和a

 
content1
content2

使用上面的Nuri Yilmaz代码,这里是一个jquery插件,使标签完全不使用id:

 /** * use: * * 
* *
some content
* ... some more div.tab_el *
* * */ (function( $ ){ $.fn.noIdTab = function() { this.each(function(){ var rand = 'spec' + (new Date()).getTime() + Math.floor((Math.random()*25)+65); $(this).find('ul.super li a').each(function (index) { $(this).attr("href", "#" + rand + index.toString()); }); $(this).find('div.tab_el').each(function (index) { $(this).attr("id", rand + index.toString()); }); $(this).tabs(); }); }; })( jQuery );