I am a beginner, and I have a problem with my code in JavaScript. Can someone tell me what's wrong here because the code does not work
document.addEventListener('DOMContentLoaded', function() {
function redf() {
document.querySelector('h1').style = 'red';
};
document.querySelector('#red').onclick = redf();
});
<h1>Hello, World!</h1>
<div>
<button id="red" style="color: red;">Red</button>
<button id="blue" style="color: blue;">Blue</button>
<button id="green" style="color: springgreen;">Green</button>
</div>