JavaScript:
<script>
var myTwoTags = document.getElementsByClassName("className");
function changeColor() {
myTwoTags.style.color = "#f00";
}
</script>
<button onclick="changeColor()">change color </button>
<h1 class='className'>Change my color</h1>
<p class='className'>Change my color, too</p>
jQuery
$('className').on("click", function() {
})