$(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("不是同一个元素")

  }

})

相关文章: