[jQuery] Re: How to rewrite this in jQuery?

2009-04-20 Thread Enrico
Well, I think you don't have to turn your rel attributes into IDs. Once you can access the tabs (as Dave explained) and distinguish them, you're good to go. Best regards, Enrico

[jQuery] Re: How to rewrite this in jQuery?

2009-04-20 Thread Matt Kruse
On Apr 19, 8:38 pm, Dave Methvin wrote: > How about this? > $("div[rel]").each(function(){ >    $(this).attr("id", $(this).attr("rel")); > }); There is no need to create two jQuery objects then throw them away, or to use the clumsy attr() method. Just do: $("div[rel]").each(function(){ if (!

[jQuery] Re: How to rewrite this in jQuery?

2009-04-19 Thread Dave Methvin
> How can I make jQuery read say this code: > > > > > and replace the 'rel' with 'id' ? Or is this asking too much? How about this? $("div[rel]").each(function(){ $(this).attr("id", $(this).attr("rel")); });