Cheers for that!
It doesn't work though.  I should point out that the divs with the IDs
are elsewhere in the document, not near the select - but that
shouldn't matter should it?
Is there some way I can debug it to print out the ID so I can make
sure it's doing what I want it to do?

On Nov 5, 7:23 pm, Wizzud <[EMAIL PROTECTED]> wrote:
> This is all you need inside the change() function...
>
>         $('#' + $('option:selected', this).attr('class')).show();
>
> On Nov 5, 1:38 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > $(document).ready(function() {
> >           $('div.hidden').hide();
> >           $('#node-58 > select.state').change(function () {
> >           $(this).find("option:selected");  // I think this line needs
> > a function to wrap the next bit of code?
> >           var equiv = $('#' + this.className);
> >                   if(equiv.length){
> >                         equiv.show();
> >                   }
> >           });
>
> > });
>
> > Explanation: I have a bunch of divs with class 'hidden' that
> > automatically have to hide. Those divs also have IDs each
> > corresponding to a CLASS on an <option> tag within a <select> box.
> > The idea is that when you choose an option with class ".foo" it will
> > show the div with ID "#foo".
>
> > So far my .hidden divs get hidden, but they never get activated by the
> > select box.

Reply via email to