zoukankan      html  css  js  c++  java
  • js-循环中判断两次点击是否是同一元素

    $(elm).click(function(){

      if($(this).attr('num')){

        console.log("同一个元素")

      }else{

        for(let i=0;i<elm.length;i++){

          $(elem).eq(i).removeAttr('num')

        }

        $(this).attr('num')

        console.log("不是同一个元素")

      }

    })

  • 相关阅读:
    12 go实现几中基本排序算法
    5 控制语句
    9 函数
    4. 常量与运算符
    AI
    AI
    AI
    AI
    ML
    ML
  • 原文地址:https://www.cnblogs.com/huangmin1992/p/7204108.html
Copyright © 2011-2022 走看看