You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It will be automatically initialized by the image-selector.lib.js Library.
Get / Set selected option
Get current selected option
// Option 1: Get IndexfunctiongetSelectedIndex(){varselector=document.getElementById('example_selector');varselectionIndex=ImageSelector.getCurrentSelectedIndex(selector);returnselectionIndex;}// Option 2: Get Option-ElementfunctiongetSelectedElement(){varselector=document.getElementById('example_selector');varselectionElement=ImageSelector.getCurrentSelected(selector);returnselectionElement;}
Set current selected option
// Option 1: Set selected option by indexfunctionsetSelectedIndex(index){varselector=document.getElementById('example_selector');ImageSelector.setSelectedIndex(selector,index);}// Option 2: Set selected option by option idfunctionsetSelectedById(id){varselector=document.getElementById('example_selector');ImageSelector.setSelectedOptionById(selector,'option_1');}// Option 3: Set selected option by option elementfunctionsetSelectedOption(option){ImageSelector.setSelectedOptionById(option);}
Overview - Available functions
Function
Return Type
Description
ImageSelector.setSelectedIndex(selector, index)
<void>
Set the selected option for a selector by a specific option index