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