拥有此数组
var eventsDates = {
"0" :["11-10-2012","21-10-2012","28-10-2012","25-11-2012","15-12-2012"],
"10":["11-10-2012"],
"11":["21-10-2012","28-10-2012"],
"12":["25-11-2012","15-12-2012"]
}
我需要通过像这样的选择保存变量某些日期组
<select>
<option value="0">all dates</option>
<option value="10">baseball</option>
<option value="11">hokey</option>
<option value="12">basket</option>
</select>
任何建议
答案 0 :(得分:3)
如果您尝试按选择值访问数组值,可以尝试 -
eventsDates[$("select").val()]