[jQuery] Re: Rename several divs

2007-07-29 Thread ahlt
On 29 Jul, 16:11, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Try this: > > $('[EMAIL PROTECTED]"foo-"]').attr('id', function() { > return this.id.replace('foo', 'bar'); > > }); > > --Klaus Thank you very much. That solved my problem:)

[jQuery] Re: Rename several divs

2007-07-29 Thread Klaus Hartl
ahlt wrote: Hi I've got three div elements with id as following: "foo-1", "foo-2" and "bar-3". And now I want a js function to fetch all divs that have an id that starts with "foo-" and then replace it with "bar-" following with the corresponding number. I've found out how to select all elemen