Jump to content

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
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...