Currently, I am facing an issue with extracting the text value of a selected option from a dropdown menu on my webpage. The dropdown contains various image categories and is defined as follows:
<select class="form-control" data-bind="options: imageCategoryList, value: 'Category', optionsCaption: --Select Category--, optionsText: 'Category', optionsValue: 'Category', event: {change: GetImages}" id="Category" name="Category"></select>
Despite having a viewModel set up in Javascript, attempting to retrieve the selected text value using the following code does not provide the desired result:
var img = self.imageCategoryList().Text
The above snippet only returns "undefined". Can anyone offer guidance on how to successfully obtain the selected text value?
Your help is greatly appreciated!