Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 11 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
jQuery 将始终返回一个对象(即使选择器不匹配任何元素),因此您的条件:
...将始终为 true。
检查长度:
下一期:
我想你需要将其切换为:
当前,如果 .next() 为空,则选择它。
jQuery will always return an object(even if the selector doesn't match any element), so your condition:
...will always be true.
Check the length instead:
the next issue:
I guess you need to switch this to:
Currently you select the .next() if it is empty.