Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 日韩在线视频线视频免费网站,精品在线观看国产,亚洲国产精品久久久久久

          整合營銷服務商

          電腦端+手機端+微信端=數據同步管理

          免費咨詢熱線:

          jq實現全選,全取消,反選

          jq實現全選,全取消,反選

          lt;!doctype html>

          <html>

          <head>

          <meta charset="UTF-8">

          <title>Document</title>

          <script type="text/javascript" src="jquery.min.js"></script>

          </head>

          <body>

          <input type="checkbox" id="checkbox1"><label for="checkbox1">庫里</label><br>

          <input type="checkbox" id="checkbox2"><label for="checkbox2">科比</label><br>

          <input type="checkbox" id="checkbox3"><label for="checkbox3">麥迪</label><br>

          <input type="checkbox" id="checkbox4"><label for="checkbox4">鄧肯</label><br>

          <input type="checkbox" id="checkbox5"><label for="checkbox5">奧尼爾</label><br><br>

          <button>全選</button><button>全不選</button><button>反選</button>

          </body>

          </html>

          <script type="text/javascript">

          $(function(){

          //匹配第一個button

          $(':button:eq(0)').click(function(){

          //全部選中 checked=true,在前臺就是表示選中

          $(':checkbox').attr('checked',true);

          });

          //匹配第二個button

          $(':button:eq(1)').click(function(){

          //全部取消 checked=false,在前臺就是表示未選中

          $(':checkbox').attr('checked',false);

          });

          //匹配第三個button

          $(':button:eq(2)').click(function(){

          //查找每一個復選框,然后取相反

          $(':checkbox').each(function(){

          $(this).attr('checked',!$(this).attr('checked'));

          });

          });

          })

          </script>

          、CSS方法

          .disabled { pointer-events: none; }

          二、jQuery方法

          方法一

          $(this).click(function (event) {
              event.preventDefault();
          }

          方法二

          $('a').live('click', function(event) {
              alert("抱歉,已停用!");
              event.preventDefault();
          });

          注:此方法中的live亦可以為on, bind等方法

          方法三

          $('.disableCss').removeAttr('onclick'); //去掉標簽中的onclick事件

          通過removeAttr方法來控制html標簽的屬性已達到啟用或禁用事件。另, 使用這種方式也可以控制其他事件或其他效果。

          方法四

          $('#button').attr('disabled',"true");//添加disabled屬性
          $('#button').removeAttr("disabled"); //移除disabled屬性

          注:和方法三是一樣的, 不過disabled屬性一般用在類型為button或submit的input上

          s vue jq消除某個元素的click點擊事件

          原生js:

          //頁面
          <div style="margin-top:20px;">
              <button onclick="clickMethod()" id="btn">點我</button>
              <button onclick="clearMethod()" >清除方法</button>
              <button onclick="clearMethod2()" id="btn2">jq清除方法</button>
          </div>
          • 可以直接賦值為空,但是清除后,再次點擊,控制臺會報錯
          • 直接修改方法,雖然沒有報錯,但是也沒有清除,當然也要以return false
          • 直接刪除onclick,這個最完美
          //原生js清除單擊事件
              function clickMethod(){
                  alert('我被點擊了')
              }
              function clearMethod(){
                  // clickMethod=""  //會報錯
                  // clickMethod=function(){
                  //     console.log("我被修改了")
                  // }
                  console.log(document.getElementById('btn'))
                  document.getElementById('btn').onclick=""  //不會報錯
          
              }

          jquery:直接了當

           //jq清除單擊事件
              function clearMethod2(){
                  $('#btn').removeAttr('onclick')
              }

          vue

          vue沒有提供刪除事件的方法,但是可以通過賦值的方式:

          還有一種方式,通過增加一個變量的方式來完成不讓元素的事件觸發


          主站蜘蛛池模板: 波多野结衣免费一区视频 | 亚洲一区二区三区四区视频| 精品视频一区二区三区在线观看| 狠狠爱无码一区二区三区| 国模少妇一区二区三区| 国产一区二区三区不卡在线看 | 久久国产午夜一区二区福利| 视频一区二区三区免费观看| 精品国产一区二区三区久久| 国产福利日本一区二区三区| 人妻无码一区二区三区四区| 日韩精品一区二区亚洲AV观看| 无码人妻一区二区三区在线视频| 国产美女视频一区| 国内自拍视频一区二区三区| 久久一区二区免费播放| 亚洲AV无码一区二区三区鸳鸯影院 | 农村人乱弄一区二区 | 国产在线不卡一区二区三区 | 精品香蕉一区二区三区| 美女视频黄a视频全免费网站一区| 国产一区二区三区无码免费| 亚洲一区二区三区久久久久| 国产在线精品一区二区不卡麻豆| 国产精品高清一区二区三区| 日韩精品无码Av一区二区| 国产AV天堂无码一区二区三区 | 国产成人高清精品一区二区三区| 精品人妻一区二区三区毛片 | 人妻激情偷乱视频一区二区三区| 日韩a无吗一区二区三区| 日本精品一区二区三本中文| 国产乱码一区二区三区| 学生妹亚洲一区二区| 亚洲国产欧美一区二区三区| 色屁屁一区二区三区视频国产| 日韩人妻无码一区二区三区99| 精品女同一区二区三区免费播放 | 日本美女一区二区三区| 国产精品毛片a∨一区二区三区 | 麻豆一区二区免费播放网站|