-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
56 lines (48 loc) · 1.53 KB
/
script.js
File metadata and controls
56 lines (48 loc) · 1.53 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
let input = document.getElementById('input')
let text = document.getElementById('head')
let pera = document.getElementById('pera')
let pera2 = document.getElementById('pera2')
let img = document.getElementById('qrimg')
let btn = document.getElementsByClassName('btn2')
let box = document.getElementById('box2');
let down = document.getElementById('down');
let bttn = document.getElementById('bttn');
let reload = document.querySelector("#btn-re");
let conte = document.querySelector(".conte");
let btn2 = document.querySelector(".btn2");
var im;
console.log(reload)
function qr() {
if (input.value.length > 0 && input.checkValidity()) {
box.classList.add("a")
im = img.src = 'https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=' + input.value
pera.innerHTML = 'Scan This QR Code'
pera2.innerHTML = im
down.onclick = down.href = im
bttn.classList.remove('opa')
reload.classList.remove('opa1')
conte.classList.remove('opa2')
console.log(reload)
// document.getElementById("bttn").classList.remove("opa");
console.log(bttn)
text.innerHTML = ''
btn2.classList.add('displa')
// btn2.onclick = down.href = im
}
else {
text.innerHTML = 'Please enter valid link OR add https://'
}
}
input.addEventListener("keypress", function(event) {
if (event.key === "Enter") {
qr()
}
})
let aa = "https://www.google.com/"
function dow() {
down.href = aa
};
function relod() {
reload = window.location.reload()
}
console.log(im)