点击其他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" />
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" />