You need to know about the Document Object Model to get at those elements. You also need to learn to use a for loop.
There are plenty of tutorials on the web. This is bread and butter stuff....you're better off learning yourself rather than having us give you the code.
Bookmarks