you should be able to include all those elements in a single set, and then apply the styles once. for example:
$(this).find("a").css("text-decoration" , "underline"); Note that this will grab ALL the descendant links inside the .JQorangeHighlight element. On Jul 10, 8:33 am, "Jacques Choquette - WhistlerGraphicDesign.com" <j...@whistlergraphicdesign.com> wrote: > Hi there I am new to jquery tonight and I have already build the below > script and everything seems to be working however I suspect there is a > better way to write this out? > > like for instance here > > $(this).children("h3").children("a").css("text-decoration", > "underline");$(this).children("a").css("text-decoration", > "underline"); > > I am changing the css text decoration on A tags within H3 elements and > also on child A tags is there not a way to bundle these together? so I > would only have to write out the .css("text-decoration", "underline"); > part once? > > Please advise > > Here is my full script it uses the 1.3.1 jquery and the color plugin > > $(".JQorangeHighlight").hover( > function() {$(this).children("h3").children("a").css("text- > decoration", "underline");$(this).children("a").css("text-decoration", > "underline");$(this).animate({ backgroundColor: "orange" }, 500); $ > (this).children("p").animate({ color: "white" }, 400) }, > function() {$(this).children("h3").children("a").css("text- > decoration", "none");$(this).children("a").css("text-decoration", > "none");$(this).animate({ backgroundColor: "eggshell" }, 500); $ > (this).children("p").animate({ color: "grey" }, 500) > });