用 div 包裹你的文本框,说“thisWrapper”
<div id="thisWrapper">
    <input type="checkbox" id="check-1" class="checkchoice staff" required><label for="check-1" class="choice staff">Staff</label>
    <input type="checkbox" id="check-2" class="checkchoice student" required><label for="check-2" class="choice student">Student</label>
</div>
并在您发布的更改事件中添加:
  $("thisWrapper").hide();
这应该同时隐藏两个复选框。当然,您必须添加“取消”或“重置”按钮才能再次显示复选框。
或者你可以给复选框一个新的类名,比如“mycheckboxes”,然后调用它:
$(".mycheckboxes").click(function() {
        $('#check-1').hide();
$("#check-2").hide();
});
* 这是我在 Fiddler 中工作的完整示例 **
试试这个:
<div id="thisWrapper">
    <input type="checkbox" id="check-1" class="checkchoice" required><label for="check-1" class="choice staff">Staff</label>
    <input type="checkbox" id="check-2" class="checkchoice" required><label for="check-2" class="choice student">Student</label>
</div>
<div id="nameinput">
    <input type="text" placeholder="So what's your name?" />
</div>
<script>
    $(function() {
       $(".checkchoice").change(function() {
              $("#thisWrapper").hide();
               $("#nameinput").show();
       });
    });
</script>