Mercurial > qr-html
comparison index.html @ 9:5998f1f51877
Simplify selector
author | nanaya <me@nanaya.pro> |
---|---|
date | Sat, 28 Nov 2020 06:12:04 +0900 |
parents | e50d930b2af1 |
children | 09146b1bfb65 |
comparison
equal
deleted
inserted
replaced
8:e50d930b2af1 | 9:5998f1f51877 |
---|---|
81 </div> | 81 </div> |
82 | 82 |
83 <script src="qrcode.min.js"></script> | 83 <script src="qrcode.min.js"></script> |
84 | 84 |
85 <script> | 85 <script> |
86 var inputDom = document.getElementsByClassName("js-qr-input")[0] | 86 var inputDom = document.querySelector(".js-qr-input") |
87 var outputDom = document.getElementsByClassName("js-qr-output")[0] | 87 var outputDom = document.querySelector(".js-qr-output") |
88 var qr = new QRCode(outputDom, { correctLevel: QRCode.CorrectLevel.L }) | 88 var qr = new QRCode(outputDom, { correctLevel: QRCode.CorrectLevel.L }) |
89 | 89 |
90 var runTimeout = null | 90 var runTimeout = null |
91 var debouncedRefreshCode = function() { | 91 var debouncedRefreshCode = function() { |
92 clearTimeout(runTimeout) | 92 clearTimeout(runTimeout) |