Skip to content

Commit

Permalink
Create QR
Browse files Browse the repository at this point in the history
  • Loading branch information
sman4muarateweh authored Jul 6, 2023
1 parent 10f1a35 commit cb4bfdc
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions QR
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

<head>
<script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"></script>
</head>
<body>
<h1>QR Code Generator</h1>
<p>Enter text or URL:</p>
<input type="text" id="inputText">
<button onclick="generateQRCode()">Generate QR Code</button>
<div id="qrcode"></div>
<script>
var qrcode = null;
function generateQRCode() {
if (qrcode) {
qrcode.clear();
}

var text = document.getElementById("inputText").value;
var qrcodeElement = document.getElementById("qrcode");
qrcode = new QRCode(qrcodeElement, {
text: text,
width: 128,
height: 128
});
}
</script>
</body>

0 comments on commit cb4bfdc

Please sign in to comment.