1var elements = document.getElementsByClassName('className');
2var requiredElement = elements[0];
1var targetDiv = document.getElementById("foo").getElementsByClassName("bar")[0];
2targetDiv.textContent = "Goodbye world!";
1var targetDiv = document.getElementById("foo").getElementsByClassName("bar")[0];
2