Hello everyone, how to show only the text of the selected item in the sp-dropdown?
html:
<sp-dropdown id="list_MD" placeholder="Make a selection..." style="width: 320px">
<sp-menu slot="options">
<sp-menu-item> Img_001 </sp-menu-item>
<sp-menu-item> Img_002 </sp-menu-item>
<sp-menu-item> Img_003 </sp-menu-item>
</sp-menu>
</sp-dropdown>
js:
var e = document.getElementById("list_MD");
app.showAlert(e.options[e.selectedIndex].text);
That didn’t work, could someone find the correct way?