if($('#isAgeSelected').attr('checked')){ $(“#txtAge”).show(); }其他{ $(“#txtAge”).hide(); }
<script src=“ https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js “></script> <input type=“checkbox”id=“isAgeSelected”/> <div id=“txtAge”style=“display:none”> 已选择年龄 </div>