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 日韩电影网址,中文字幕一区二区三区在线观看,欧美最猛性xxxx69交

          整合營銷服務商

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

          免費咨詢熱線:

          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沒有提供刪除事件的方法,但是可以通過賦值的方式:

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


          主站蜘蛛池模板: 国产熟女一区二区三区四区五区 | 一区二区三区观看免费中文视频在线播放 | 国产91精品一区| 国语精品一区二区三区| 精品日韩一区二区| 国产精品视频分类一区| 人妻免费一区二区三区最新| 欲色影视天天一区二区三区色香欲| 亚洲熟妇av一区| 末成年女AV片一区二区 | 国模精品一区二区三区视频 | 久久综合一区二区无码| 亚洲AV成人一区二区三区观看| 亚洲国产成人一区二区精品区| 中文字幕一区在线观看| 久久综合一区二区无码| 亚洲国产专区一区| 日韩动漫av在线播放一区| 尤物精品视频一区二区三区| 日韩在线一区二区| 亚洲国产AV无码一区二区三区| 精品不卡一区二区| 日韩一区二区视频| 亚洲熟妇无码一区二区三区| 亚洲AV成人一区二区三区在线看 | 日韩视频在线一区| 女同一区二区在线观看| 女同一区二区在线观看| 国产精品伦子一区二区三区| 精品无人乱码一区二区三区| 好爽毛片一区二区三区四无码三飞| 中文字幕乱码亚洲精品一区 | 国产精品视频第一区二区三区| 99精品高清视频一区二区| 国产一区二区高清在线播放| 久久一区二区明星换脸| AA区一区二区三无码精片| 色一情一乱一区二区三区啪啪高| 韩国女主播一区二区| 亚洲片一区二区三区| 久久se精品一区精品二区|