示例代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
<script src="https://cdn.bootcss.com/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
<body>
<div id="qrcode" style="width:180px;text-align:center;margin:0 auto;"></div>
</body>
<script>
$("#qrcode").qrcode({
width: 200,
height: 200,
text: "https://www.baidu.com/",
background://背景色,
foreground://前景色
})
</script>
</html>
来源:CSDN
作者:php小影
链接:https://blog.csdn.net/weixin_43993175/article/details/103823592