Is there any way to use document.getElementById but for classes? getElementById sure is useful but sometimes you need to get at a class instead and you can't always change it to an id.