3.
document.addEventListener('DOMContentLoaded', function() {
const listener = function() {
console.log(this.value || '');
};
const node = document.getElementById('name_button');
if (!node)
throw new Error('Element not found');
['change', 'input'].forEach(function(event) {
node.addEventListener(event, listener);
});
});