Okay, so I understnad how the class attribute works in CSS: I can specify that every attribute with class="foo" be italicized with:
.foo {font-style: italic;}

What if I want to do the same sort of thing in Javascript? Is there something built-in like
document.GetElementsbyClass("foo").style = "italic" (I'm just making this code up of the top of my head, I don't know how javascript works.)

It seems to me that with JavaScript you're supposed to use the name="" attribute instead of class="". Why the diference?

I looked at webmonkey that had an article about this, but their writing style is simply confusing and I can't make heads or tails of their articles.

Any suggestions appreciated.