Question: I'm currently making a game, and I'm trying to change the CSS values of a whole class of objects. For a single ID, I would use, `document.getElementById("idHere")`, but I need something like `document.getElementByClass("classHere")`. Thanks!

Answer: 
There is simply `document.getElementsByClassName("myClass")`, which returns an array of all the elements with that HTML class.

If you're using jQuery, you can do it with `$(".myClass")`, which will return a collection of all of the elements with that class.
If you can't or don't want to use jQuery, do the following:

---

function changeClassName(className, newClassName) {

```
    var elements = document.getElementsByClassName(className);

    for (var i = 0; i < elements; ++i) {
        var item = elements[i];  
        item.className = newClassName;
    }

```

}

---

If you decide to use jQuery:

function changeClassName(className, newClassName) {

```
    $('.'+className).toggleClass(newClassName);

```

}