<div class="container">
  <form action="">
    <div class="form-group">
      <input type="text" class="form-control" required>
    </div>
    <div class="form-group">
      <div class="form-check form-check-inline">
  <input class="form-check-input" type="checkbox" id="" name="checkbox" value="option1">
  <label class="form-check-label" for="">1</label>
</div>
      <div class="form-check form-check-inline">
  <input class="form-check-input" type="checkbox" id="" name="checkbox" value="option2">
  <label class="form-check-label" for="">2</label>
</div>
      <div class="form-check form-check-inline">
  <input class="form-check-input" type="checkbox" id="" name="checkbox" value="option3">
  <label class="form-check-label" for="">3</label>
</div>
    </div>
    
    <button type="submit" class="btn btn-info">送出</button>
  </form>
</div>
$(".form-check-input").click(function(){
  let checkedCount=$(".form-check-input:checked").length;
  console.log(checkedCount)
})

External CSS

  1. https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js