js之动态的变换css属性和随机生成六位数字验证码

tab.click(function () {
   $(this).addClass("active");
   $(this).siblings().removeClass("active"); 
});

.active{
  background: #ccc;
}

  .siblings() 返回被选元素的所有同级元素

const code = Math.floor(Math.random() * 1000000).toString().padStart(6, "0");
// 942377

随机生成六位数字

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章