Q:

Use browser console to select drop down boxes in webpage table

First, this is my first project outside VBA and I thought it would be easy... maybe not. 
We have a client website that we fill out a form in. It is over 400 rows of just selecting "Yes" from a drop down menu. I do not have any ability to change the HTML code, other than the session version. Is it possible to use the in-browser console to identify the HTML element, and select a certain option? Below is the tables code showing what would need changed, and a version of stuff I have tried before. The browser console just says 'undefined' to what I try.
<select class="row" id="17.5.1" style="width:350px;font-family:Segoe UI;font-size:13px;" onchange="OnChangeElement(id)"><option></option><option selected="">Yes</option><option>No</option><option>NA</option></select>

What I have tried in the console, one of the many variations
function loop(tested){
var i;
for(i=1; i<20; i++){
//HTMLSelectElement("17.5.1");
//select.getOptionByValue("No");
//select.setSelectedAttribute(option, true);
$("17.5.1").getOptionByValue('No').setSelectedAttribute(option, true);
}
}

I know almost no java... So I apologize if I do not know more.
Thanks!!

A:

First you'll want to select all of the <select> elements from the document.
const selects = document.querySelectorAll('select');

And then loop over each select element in a loop to manipulate each <select> tag. In the example below the singular select constant is the current select element that we are looping over.
for (const select of selects) {
  ...
}

Then inside the loop you'll want to see the options of each select element, so we can see which ones have the values that you are looking for. Loop again over all the options by first converting the HTMLOptionsCollection, which is an object with all options, to an array and check if the value property equals the value that you try to set. This way you don't accidentally set the wrong value on the wrong <select> element. If it has that value, set the value directly on the select element.
for (const select of selects) {
  const { options } = select;
  const hasValue = Array.from(options).some((option) => option.textContent === 'Yes');
  if (hasValue) {
    select.value = 'Yes';
  }
}

Or when you only have to select a single element by id use:
const select = document.getElementById('17.5.1');
const { options } = select;
const hasValue = Array.from(options).some((option) => option.textContent === 'Yes');
if (hasValue) {
  select.value = 'Yes';
}

