How to block text?

There is a table, in it there is a line
the <tr>
 <td colspan="7" class="hide-tr search-click">Administration</td>

Lines with class search-click can be a lot.
When I click on one of the blocks with the class - need to text.
Doing so

But for some reason it displays an empty alert, if instead of this point the class will not what you need(or rather displays of all the blocks). How to be?
April 4th 20 at 00:37
2 answers
April 4th 20 at 00:39
Use the pointer to function => don't Ask why this works

Or write to function () or send (event)=>$(
April 4th 20 at 00:41
The version without jquery:
const allSrchTD = document.querySelectAll('.search-click');
allSrchTD.forEach(td => td.addEventListener('click', event => { alert(; }));

PS. format code, writing from phone

Find more questions by tags jQuery