JS 最少代码实现随机十位字符串
感谢群友(贾顺名)的指点
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script> //实现随机10位字符串 document.write(Math.random().toString(36).substr(-10)); </script> </body> </html>
效果图:
感谢群友(贾顺名)的指点
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script> //实现随机10位字符串 document.write(Math.random().toString(36).substr(-10)); </script> </body> </html>
效果图: