I want to style the colour of the h1 elements to black that are not "this" on click. So it will turn the h1 red on click and not this to black.
<script>
window.addEventListener('load', function() {
var h1Loop = document.querySelectorAll("h1");
for(var i = 0; i < h1Loop.length; i++) {
h1Loop[i].addEventListener("click", function () {
this.style.color = "red";
not this.style.color = "black"
});
}
});
</script>
<h1>Test</h1>
<h1>Testing</h1>
<h1>Test One</h1>