To get element by name with JavaScript, we use the getElementsByName
method.
For instance, we write
const val = document.getElementsByName("acc")[0].value;
to select the first element with name attribute acc
with
document.getElementsByName("acc")[0]
Then we get its value with the value
property.