<h1>Overskrift</h1> <button>Say Hello</button>
function sayHello() {
document.querySelector('h1').textContent = 'Hello World!';
}
document.querySelector('button').addEventListener('click', sayHello);
Hints
const heading = document.querySelector('h1');
const btn = document.querySelector('button');
function sayHello() {
heading.textContent = 'Hello World!';
}
btn.addEventListener('click', sayHello);