2010-03-28 19 views

cevap

8

şey:

<input type="radio" name="foo" value="top" /> 
<input type="radio" name="foo" value="bottom" /> 

Ve jQuery

:

$('input[name=foo]').click(function() { 
    if($(this).val() == "top") { 
     $('#textbox').hide(); 
    } else { 
     $('#textbox').show(); 
    } 
}); 

clickchange çünkü IE üzerinde düzgün çalışması için görünmüyor.

1

Bu, radyonuzun aynı ada sahip olmaması durumunda, olayı seçilen bir telsize eklemenizi sağlar.

$('checkbox-selector').click(function() { 
    if ($(this).is(':checked')) { 
     $('textbox-selector').hide(); 
    } 
    else { 
     $('textbox-selector').show(); 
    } 
});