У меня есть 3 радио-кнопки.
* при нажатии на кнопку «Электронная почта» будет отображаться только текстовое поле электронной почты
*, если при щелчке по коллекции будет отображаться только текстовое поле коллекции и будут скрываться другие элементы Div.Как я могу это сделать?приведенный ниже код только показывает, но не скрывает после изменения!
<input type="radio" name="d_method" class="c_email"/>Email
<input name="d_method" type="radio" class="c_collection"/>Colletion
<input name="d_method" type="radio" class="c_post"/>Post
и 3 скрытых элемента div с идентификатором:
<div id="c_email" style="display:none;">
email textbox
</div>
<div id="c_collection" style="display:none;">
collection textbox
</div>
<div id="c_post" style="display:none;">
post textbox
</div>
и jquery:
$('.c_email').change(function() {
$('#c_email').stop().fadeIn();
}, function(){
$('#c_email').stop().hide();
})
$('.c_collection').change(function() {
$('#c_collection').stop().fadeIn();
}, function(){
$('#c_collection').stop().hide();
})
$('.c_post').change(function() {
$('#c_post').stop().fadeIn();
}, function(){
$('#c_post').stop().hide();
})