我正在尝试选中此复选框并测试它是否被选中
<input class="controls" id="user_regret_avatar" label="Delete My Picture" name="user[regret_avatar]" type="checkbox" value="1">
有了这个
if $("#user_regret_avatar").attr('checked') {
alert("yay");
}
else{
alert("aww");
};
但我得到
Uncaught SyntaxError: Unexpected identifier
我的选择器坏了吗?
另请注意 - 我已经看过http://api.jquery.com/prop/,我已经检查了所有检查过的测试.. 仍然是同样的问题
现在用小提琴- 无法进行测试