<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