It has to be stored somewhere though...

Say, for example, we bind a handler to the click event on the BODY of
the document and we log the "pen" object to the console.

$(function(){

        var pen =
        {
                        type: "Ballpoint",
                        color: "blue",
                        hasInk: true
        }

        $("BODY").click(function(){
                console.log(pen)
        })

});

As you can see when you run that code, the "pen" object is logged to
the console so it has to be stored somewhere...

Where, is the question.

On Oct 24, 8:01 pm, donb <falconwatc...@comcast.net> wrote:
> You can't.  It exists for the duration of the ready function, then
> it's gone.
>
> On Oct 24, 7:51 pm, Nikola <nik.cod...@gmail.com> wrote:
>
> > Hi, I've been trying to understand a little tidbit of jQuery here...
>
> > Lets say we define an object in the Document "ready" method:
>
> > $(function(){
>
> >         var pen =
> >         {
> >                 type: "Ballpoint",
> >                 color: "blue",
> >                 hasInk: true
> >         }
>
> > });
>
> > Where in the DOM can we find the pen object?

Reply via email to