点击其他checkbox,然后显示和隐藏区域

在复杂表单的时候会用到.

 

<script type="text/javascript">
    
function chkchange(){
        $tmp 
= $('#chk').attr('checked');
        
if($tmp == true){
            $(
'#inptxt').css('display','');
        }
else{
            $(
'#inptxt').css('display','none');
        }
    }
</script>


<input type="checkbox" id="chk" value="" name="chk" onclick="chkchange();" /><label for="chk">其他</label>
<input type="text" id="inptxt" name="inptxt" style="display:none" />

 

 

posted on 2009-03-02 10:59  52Qin  阅读(522)  评论(0编辑  收藏  举报