The $.each function iterates over a collection, for example array.
(http://docs.jquery.com/JavaScript#.24.each.28_obj.2C_fn_.29)
It works because in javascript (without IE, ofcourse) object can be
threated as associative arrays.

If what you want is to iterate through children use $(document).each()
or $(window).each().

Regards,
Emil Ivanov

On May 12, 2:24 pm, Guapo <[EMAIL PROTECTED]> wrote:
> when i write
> $(document).ready(function(){
>         $.each(document,function(k,v){
>                 document.writeln(k+"===="+v+"<br />);
>         });});
>
> it works ,but when i change the document to window,as follows
> $(document).ready(function(){
>         $.each(window,function(k,v){
>                 document.writeln(k+"===="+v+"<br />);
>         });});
>
> nothing output,why?
> thank u all!

Reply via email to