一開始我把checkBoxOne 設置disable,onclick button 就會解除,請問怎樣知道當刻的分checkbox是否有disable再去決定 add or remove,if(????){} else if (?????????){
<button onclick="myFunction()">Button<button>
<script>
    $(".checkBoxOne").addClass("disabled").prop("disabled", true);
    
   function myFunction() {
        $(".checkBoxOne").removeClass("disabled").prop("disabled", false);
    }
    </script>
$(".checkBoxOne").addClass("disabled").prop("disabled", true);
    
function myFunction() {
  // 先把這個節點取出來,方便操作
  const checkBoxOne = $(".checkBoxOne");
  
  /* 其實不用使用判斷式,樣式的部分使用 toggleClass,
   * disabled 的部分,直接把寫死的布林值變成取值後反轉就可以
   * 如: !checkBoxOne.prop("disabled")
   */
  checkBoxOne
    .toggleClass("disabled")
    .prop("disabled", !checkBoxOne.prop("disabled"));
}