We help IT Professionals succeed at work.
Get Started

jQuery need to change individual accordian h3 tag

Charles Baldo
on
68 Views
Last Modified: 2016-01-25
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
CERTIFIED EXPERT
Expert of the Year 2008
Top Expert 2008
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE