lnzixin
<div class="btn">
    点击我吧
</div>
var ttt = Math.random().toString(16).substring(2);
$(".btn").on("click",function(){
    console.log(ttt)
})
//jquery
Math:执行数学任务的对象
random():0~1之间一个随机数
toString(16):使用16进制转换为字符串
substring(2):截取小数点后的

分类:

技术点:

相关文章:

  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-06-22
  • 2021-12-31
相关资源
相似解决方案