-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (32 loc) · 1.08 KB
/
index.html
File metadata and controls
41 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>QR code generator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class = "container">
<p>Enter your text or URL</p>
<!-- QR text id -->
<input type="text" placeholder="Text or URL" id="qrText">
<!--id image box -->
<div id="imgBox">
<!-- QR image -->
<img src="" id="qrImage"
</div>
<button onclick="GenerateQR()">Generate QR Code</button>
</div>
<script>
let imgBox = document.getElementById("imgBox");
let qrImage = document.getElementById("qrImage");
let qrText = document.getElementById("qrText");
// IT will call on the time of click the generate QR code button.
function GenerateQR(){
qrImage.src = "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data="+qrText.value;
imgBox.classList.add("show-Image")
}
</script>
</body>
</html>