Thank you for your answers, but i don't understand one thing.
I made a javascript that reads a webpage source code and puts in an array all urls of pictures of this page. Then i asked in other forum(javascript forum) how i could download these pictures. They said to me i could do that using PHP because it was better suited to this task, as JavaScript only has limited access to the local file system. And any server-side language (except maybe Classic ASP) is better suited for downloading files.
That's why i asked the question 1, because one way to find what i whant in a webpage sorce code is using getElementByClassName(). But now, i don't know who is right, you or them because they said to me to use PHP for do what i want, but you said is not possible.
Actually i want to learn PHP for other things, but i need a motivation and make this "program", that downloads all pictures of a webpage is a good motivation for me.