I need to apply different functions to each dropdown list, but it doesn't work
var btnDrp = grpFldr2.add("dropdownlist", undefined, ["1","2","3"])
btnDrp.selection = 0
var btnApply = grpFldr2.add("button", undefined, "Apply");
if (btnDrp.index == 0) {
btnApply.onClick = function(){
alert("Hello")
}
}