I have an amazon website URL here: https://www.amazon.com/dp/B07DKCQSQ5
I'm trying to write some javascript code so that I can select one of the size options in the size dropdown
I'm trying to get a size option selected by opening the devtools console on the page and running some javascript code in the console.
This code: document.querySelector('#native_dropdown_selected_size_name')
grabs the correct dropdown, and I can view all the nested option elements.
I tried to get all the nested option elements and click on with this code:
document.querySelector('#native_dropdown_selected_size_name').querySelectorAll('option')[3].click()
but it just returns undefined and nothing gets selected?
I'm trying to write the code in pure javascript (no jquery)