jQuery need to change individual accordian h3 tag

Charles Baldo
Charles Baldo used Ask the Experts™
on
I have a jQuery accordian widget that I need to  change the background color of the h3 depending on a  .change event
using asp.net and  jQuery. Everything below works except the specific  color change of the h3 tag

 
    
  
   /*  asp.net */

           <div id="accordion">
                <h3 id="h3Accordianid">Header  h3 text</h3>
                   <div class="inputblock200px">
                        <asp:DropDownList ID="ddList" runat="server" />                
                    </div>
                ...
                ...
           </div>
               
/*  jQuery */

        $(document).ready(function () {
            $('#ddList').change(function () {
                 alert('This definitely fires');
                 $('#accordion .ui-accordion-header h3Accordianid').addClass('navyblue');
            });
        });


/* css */

        #accordion .ui-accordion-header {
            background: #703800; 
            color: white;
        }

        .navyblue {
              background-color:navy;
              color:white;
        }

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Expert of the Year 2008
Top Expert 2008
Commented:
Try:
/*  jQuery */

        $(document).ready(function () {
            $('#ddList').change(function () {
                 alert('This definitely fires');
                 $('#accordion .ui-accordion-header h3Accordianid').addClass('navyblue');
                 $('#accordion h3').addClass('h3_header');
            });
        });

/* css */
#accordion h3.h3_header{background-color: lightblue;}

Open in new window

Charles BaldoSoftware Developer

Author

Commented:
Sweet worked perfect thanks a ton

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial