Jump to content
Sign in to follow this  

Get innertext of a specific value

Recommended Posts


Hi Guys,

I have a dropdown in IE with values:

<option value="Chocolate"> You selected chocolate! </option>
<option value="Cheese"> You selected cheese! </option>
<option value="Oreo"> You selected oreo! </option>

I have a simple code that is selecting the item in the dropdown per value:

$user = "Cheese"
$oSelectBox = _IEGetObjByName ($oIE, "food_list")
_IEAction($oSelectBox, "focus")
_IEFormElementOptionSelect($oSelectBox, $user, 1)

What I need is to retrieve the innertext of the current selected value. So in the example above, I need it to return "You selected cheese!" in a variable $selected.

How can I do this?

Edited by PunkoHead

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.