Here is a simple example that generates a QR code using JavaScript and the QRcode.js library:
<!DOCTYPE html>
<html>
<head>
<title>QR Code Generator</title>
<script src="https://cdn.jsdelivr.net/npm/qrcode@1.4.4/build/qrcode.min.js"></script>
</head>
<body>
<div id="qrcode"></div>
<script>
var qrcode = new QRCode(document.getElementById("qrcode"), {
text: "http://www.example.com",
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
</script>
</body>
</html>
This code creates a new QR code object, and passes it several options, including the text to be encoded in the QR code (in this case, a URL), and the size and colors of the QR code.
You can customize the QR code by modifying the options passed to the QR code object. For example, you can change the text to be encoded, the size of the QR code, the colors, and more.
I hope this helps! Let me know if you have any questions.

0 Comments