Hi everyone, I am trying to create a QR code generator an Javascript is not working, I can’t figure out what am I doing wrong, could someone please help?
Code:
1) const image = document.querySelector("#QR");
2) const ssid = document.querySelector("#ssid");
3) const password = document.querySelector("#password");
4) const button = document.querySelector("#button");
5)
6) generate.onclick = function(){
7)
8) const wifi = `WIFI:T:WPA;S:${ssid.value};P:${password.value};;`;
9) image.src = `https://api.qrserver.com/v1/create-qr-code/?size=164x164&data=${wifi}`;
10)
11) ssid.addEventListener(
12) 'keyup',
13) update,
14) ;
15)
16) password.addEventListener(
17) 'keyup',
18) update,
19) );
20) };
ERROR:
Uncaught ReferenceError ReferenceError: update is not defined
at generate.onclick (script.js:13:5)