Single handler for multiple elements in JavaScript

A single function can be bound to multiple elements at once. For example, let's say we have the following function:

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

There are also two buttons:

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

Get references to these buttons into variables:

javascriptlet button1 = document.querySelector('#button1');
let button2 = document.querySelector('#button2');

And now let's bind our function func to both the first and the second button:

javascriptbutton1.addEventListener('click', func);
button2.addEventListener('click', func);
Задание 1

Given 5 paragraphs:

html<p id="elem1">text</p>
<p id="elem2">text</p>
<p id="elem3">text</p>
<p id="elem4">text</p>
<p id="elem5">text</p>

Given the following function:

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

Bind this function to all 5 paragraphs.