JS 选中时显示字段
如果选中#tryout 复选框,如何显示输入字段。
我已经有了隐藏 2 个字段的内容,现在我想显示 3 个新字段..:
$('#tryout').click(function () {
$('#title').toggle(!$(this).attr('checked'));
$('.navn').toggle(!$(this).attr('checked'));
});
How do i show an input field if #tryout checkbox is checked.
I already have this which hides 2 fields, now i want to show 3 new fields..:
$('#tryout').click(function () {
$('#title').toggle(!$(this).attr('checked'));
$('.navn').toggle(!$(this).attr('checked'));
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下链接你的选择器:
Chain your selectors in this case: