点击按钮生成4位随机验证码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div {
width: 100px;
height: 50px;
background: red;
text-align: center;
line-height: 50px;
}
</style>
</head>
<body>
<div id="yzm"></div>
<button id="btn">点击生成验证码</button>
<script>
// var str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
//数组转换为字符串