Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- </head>
- <body>
- <input id="text" type="text" value="https://hogangnono.com" style="width:80%" /><br />
- <div id="qrcode"></div>
- <script type="text/javascript" src="javascripts/qrcode.min.js">
- var qrcode = new QRCode("qrcode");
- function makeCode () {
- var elText = document.getElementById("text");
- if (!elText.value) {
- alert("Input a text");
- elText.focus();
- return;
- }
- qrcode.makeCode(elText.value);
- }
- makeCode();
- $("#text").
- on("blur", function () {
- makeCode();
- }).
- on("keydown", function (e) {
- if (e.keyCode == 13) {
- makeCode();
- }
- });
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment