Why will my addClass not target only current element? : when I add class "Icon" using the if statement, it adds it to the correct h3 but also to any h3's ABOVE the correct one also. Even if the h3 above is 0. Icon will either be 0 or 1.


    { $('#accordion') .append($('<h3>') .html(Agency));
     
      
     		if (Icon == 1) {
                $('h3') .addClass('Icon');
            }
    
    		  AccordionChild = $('<div>');                                                                                         
            }
                                                                                                                                
             AccordionChild.append("<div>") .html(ToolsList);          
           
            $('#accordion').append(AccordionChild);
                                                    
          });
        }
[enter image description here][1]


  [1]: http://i.stack.imgur.com/3gy0r.png