Rename them from what to what? To change the id of all selects, you can do:

$('select').each(function() {
  var oldId = $(this).attr('id');
  $(this).attr('id', oldId.substring(0, oldId.lastIndexOf('-')));
});

I'm still not sure what you actually want to do though.

--Erik


On 9/26/07, voltron <[EMAIL PROTECTED]> wrote:
>
>
> I am trying to rename the ids and name attributes
>
> On Sep 26, 10:06 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> > What are you trying to accomplish?
> >
> > --Erik
> >
> > On 9/26/07, voltron <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > I have tags like this:
> > > <select id="academic_from_month-0" >
> > > <select id="academic_till_month-0" >
> >
> > > since the ids are variable in length, I would have to find out where
> > > the lastindex() of "-" is remove that and replace it it with the new
> > > value. My problem is the syntax, is there some kind of Jquery way to
> > > do this?
> >
> > > Thanks
>
>

Reply via email to