Ahh... lightbulb just came on. Thanks a lot.

On Jan 23, 12:09 pm, jay <jay.ab...@gmail.com> wrote:
> That makes more sense.. children() will only do immediate
> descendents.  You could also do mydiv.find(expr) as well I suppose.
>
> On Jan 23, 1:04 pm, Eric Garside <gars...@gmail.com> wrote:
>
> > var mydiv = $('#mydiv');
> > $('.childdiv', mydiv).css('font-weght', 'bold');
>
> > On Jan 23, 12:57 pm, corb <corbinc...@gmail.com> wrote:
>
> > > This may obvious, but I haven't seen any examples that fit what I'm
> > > trying to do. In many places in my code, I will select an element once
> > > into a var and make necessary changes. What I can't seem to figure out
> > > or find documentation on is querying on an existing object.
>
> > > Here's what I have to do now:
>
> > > $().ready(function(){
> > >     $("#mydiv").click(function(){alert('hello')});
> > >     $("#mydiv .childdiv").css("font-weight", "bold");}
>
> > > seems a tad inefficient to make two trips through the DOM.
>
> > > Here's what I would like to do:
> > > $().ready(function(){
> > >     var mydiv = $("#mydiv");
> > >     mydiv.click(function(){alert('hello')});
> > >    // here's where I'm lost
> > >    // find all the element identified as "childdiv" and set its css
> > >   mydiv("#childdiv").css("font-weight", "bold");
> > >  // is there a way to do this with out multiple trips to the DOM?
>
> > > }- Hide quoted text -
>
> > - Show quoted text -

Reply via email to