How to track changes of one or another element at the same time?

Hi. How to track changes of one or another element at the same time and execute the code?

Tried to make a condition like this:
if ($('input[value="Consultation"]').change() || $('select[name="worker-name"]').change()) {
 console.log("Changed input or select");
}


But it's not working.

Processing individually each modification (putting executable code inside change()) - increase in 2-3 times the amount of code (check enough).

How best to solve the issue?
April 4th 20 at 13:30
1 answer
April 4th 20 at 13:32
Solution
$('input[value="Advice"], select[name="worker-name"]').change(function (e) {
 // You Code
});


Well, you know how events work in JS?)
Still don't quite understand :( - Colton.O commented on April 4th 20 at 13:35
@Colton.O, okay, and me the above code is what you need? - bria_Homenick commented on April 4th 20 at 13:38
@bria_Homenick, Yes, it works as it should) - Colton.O commented on April 4th 20 at 13:41

Find more questions by tags JavaScriptjQuery