Named event handlers in JavaScript

In the previous lessons, we used anonymous functions as event handlers. This is actually not necessary - the function can be ordinary, with a name. For example, let's say we have the following function:

javascriptfunction func() {
  console.log('!!!');
}

Let's also have a button:

html<input id="button" type="submit">

Let's make it so that when the button is clicked, our function func is executed. To do this, with a parameter of addEventListener we will pass the name of our function, like this:

javascriptlet button = document.querySelector('#button');
button.addEventListener('click', func);

function func() {
  console.log('!!!');
}
Задание 1

Given the following HTML code:

html<input id="button1" type="submit" value="button1">
<input id="button2" type="submit" value="button2">

Given the following functions:

javascriptfunction func1() {
  console.log(1);
}

function func2() {
  console.log(2);
}

Make it so that when the first button is clicked, the function func1 is executed, and when the second button is clicked, the function func2 is executed.