Getting input value from a pre-populated dropdown field

Hi,
I am trying to get value from a dropdown field. The field is pre-populated and in edit/input mode when I am interacting with it. I am not able to see the field value in the html, and have tried both “value” and “innerHTML”. The first option (value) doesn’t return anything and second option (innerHTML) return a ton of unnecessary stuff. Any other options that will allow me to get value populated in the input field.

Screenshot below is the field and its inspect in chrome. Please note that list of options is available dropdown options, but I am interested the input field’s current value.

1 Like

In the code you shared, which one is the element from which you need to save the text? Please select the exact one, as there are several <td> elements.

Also, can you share the code of the option that is selected, Travel and Entertainment?

HI,
Below is screenshot of the Get Value. I have tried to get value without using element. I have also tried the following elements: value, innerHTML, aria-label. I am still not able to get the value of the input dropdown field.

The code of the option selected is below:

Hi @ashapkina,
Any additional insight you have for me on this issue?

@salaad unfortunately, no. It looks like the displayed value is not stored in the drop-down element.
What I can suggest is to search in the HTML code for the phrase that is pre-populated in the drop-down and see if is actually store in some other element in the code and is displayed in another one. This happens sometimes.

For example, in this website https://www.online-translator.com/ the translated word is stored in the highlighted element but is displayed in another part of the page.