The method
querySelector()
returns only a single HTML element as a result, or
null
if no possible match was found. You're using it as if it returns multiple values, which it won't.
If there are multiple elements with the same name, instead use
querySelectorAll()
which will return a collection of elements. Otherwise, I'd maybe look at giving these selects unique
id
attributes and selecting them that way. Relying on the element being at a fixed index in the query selector could probably spell trouble in the future.
const select = document.querySelectorAll('select[name="canale"]')[3];
select.value = 'CL';
const select = document.getElementById('canale3');
select.value = 'CL';