javascript set selected option by text

The selectedIndex property sets or returns the index of the selected value in a drop-down list. Get Option set name, OptionSet in D365, Set Optionset value by its text, Set optionset value in Dynamics 365, Set Optionset with specific value Leave a Reply Cancel reply Your email address will not be published. It seems that in CRM 2015 or 2015 SP1 Microsoft modified the way that the Status Reasons are handled, and although the field might seem like an Option Set, the Option Set … This tutorial explains how you can perform common operations on select element with vanilla Javascript - adding/deleting options or getting/setting the selected options. The issue that you are having is because you are trying to modify the Status Reason system field. var select = document.getElementById("example-select"); select.options[select.options.length] = new Option('Text 1', 'Value1'); Adding options from an array. Select an option from the HTML select dropdown box by the text instead of the value of a particular option using the jQuery tag. so that this