GetElementByClass
var selector = document.getElementsByClassName('class-name');
gtamborero
var selector = document.getElementsByClassName('class-name');
var elements = document.getElementsByClassName(names); // or:
var elements = rootElement.getElementsByClassName(names);
var targetDiv = document.getElementById("foo").getElementsByClassName("bar")[0];
targetDiv.textContent = "Goodbye world!";