Skip to content

Instantly share code, notes, and snippets.

@sangwin
Created December 8, 2023 11:47
Show Gist options
  • Save sangwin/c67086a92324b174b15f642e4bdd828e to your computer and use it in GitHub Desktop.
Save sangwin/c67086a92324b174b15f642e4bdd828e to your computer and use it in GitHub Desktop.
Sangwin| Creating QR Code
<!DOCTYPE html>
<html>
<head>
<title>Sangwin| Creating QR Code</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
</head>
<body>
<h1>Creating QR Code </h1>
<br/>
<h2>Simple </h2>
<div id="QRCode1"></div>
<script type="text/javascript">
new QRCode(document.getElementById("QRCode1"), "https://sangw.in");
</script>
<br/><br/><br/>
<h2>With Customizations </h2>
<div id="QRCode2"></div>
<script type="text/javascript">
var options = {
text: "https://sangw.in",
width: 128,
height: 128,
colorDark : "#FF0000",
colorLight : "#FFFFFF",
correctLevel : QRCode.CorrectLevel.H
};
var qrcode = new QRCode(document.getElementById("QRCode2"), options);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment