How do i show an input field if #tryout checkbox is chec开发者_运维技巧ked.
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'));
});
Chain your selectors in this case:
$('#tryout').click(function () {
$('#title, .navn').toggle(!$(this).attr('checked'));
$('#newfield1, #nf2, #nf3').toggle($(this).attr('checked'));
});
精彩评论