var options = {
fieldsToValidate : {},
slideDowns : {
0: '#address-phone-block',
1: '#zip-dob-block',
2: '#nextButton'
},
continueButton: "#continue-button",
landingForm: '#landingForm'
}
for (var slider in options.slideDowns[]){
console.log('did this work?' , slider , options.continueButton[slider])
$(options.continueButton[slider]).slideDown();
}
当控制台记录我得到这个输出,然后在 jQuery 选择器上出现这个错误:
did this work? 0 #
"Syntax error, unrecognized expression: #"
我知道滑块是 0/1/2 那么为什么这给了我第一个属性的第一个字符?