Programmatically selecting item in Dashcode list
-
02-10-2019 - |
Question
Is their a way to programmatically select an item in a dashcode list with having the user click on the list? Something like:
var list = document.getElementById("list");
list.select_item(3);
Solution
If it's just an HTML drop-down list (a "select" tag), then you can just set the "selectedIndex" property:
var list = document.getElementById("list");
list.selectedIndex = 3;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow