随机生成字数字、字符串

mac2022-06-30  114

<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):截取小数点后的

转载于:https://www.cnblogs.com/lnzixin/p/11431102.html

最新回复(0)